<commit_before>'use strict';

var test = require('tape');
var window = require('global/window');
var document = require('global/document');

window.addEventListener = function polyAddEventListneer() { return false; };
document.location = { href: '/articles?page=25' };

var router = require('../index');
var atom = require('../lib/router').atom;


test('init', function test(t) {
    var state = router();

    t.ok(router.render, 'has render function');
    t.ok(router.anchor, 'has anchor function');
    t.ok(state, 'state init');
    t.end();
});

test('router', function test(t) {
    var state = router();

    t.equal(
        atom(),
        document.location.href,
        'router init with full url, including query string');

    t.end();
});<commit_msg>Test for anchor returning full url instead of #.<commit_after>'use strict';

var test = require('tape');
var window = require('global/window');
var document = require('global/document');

window.addEventListener = function polyAddEventListneer() { return false; };
document.location = { href: '/articles?page=25' };

var router = require('../index');
var anchor = router.anchor;
var atom = require('../lib/router').atom;


test('init', function test_init(t) {
    var state = router();

    t.ok(router.render, 'has render function');
    t.ok(router.anchor, 'has anchor function');
    t.ok(state, 'state init');
    t.end();
});

test('router', function test_router(t) {
    t.equal(
        atom(),
        document.location.href,
        'router init with full url, including query string');

    t.end();
});

test('anchor', function test_anchor(t) {
    var link = '/article/5';
    var a = anchor({href: link});

    t.equal(a.properties.href, link, 'renders full link in href attribute');
    t.end();
});
{'fraction_non_alphanumeric': 0.17547806524184478, 'fraction_numerical': 0.00281214848143982, 'mean_word_length': 3.6449086161879896, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '563586', 'n_tokens_mistral': 544, 'n_tokens_neox': 531, 'n_words': 149}