{"size": 577, "ext": "js", "max_stars_repo_path": "src/utils/text/remove-anchor.test.js", "max_stars_repo_name": "a2/mercury-parser", "max_stars_repo_stars_event_min_datetime": "2019-02-02T01:40:42.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-31T14:08:47.000Z", "max_issues_repo_path": "src/utils/text/remove-anchor.test.js", "max_issues_repo_name": "a2/mercury-parser", "max_issues_repo_issues_event_min_datetime": "2019-02-04T19:16:18.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-16T19:31:13.000Z", "max_forks_repo_path": "src/utils/text/remove-anchor.test.js", "max_forks_repo_name": "a2/mercury-parser", "max_forks_repo_forks_event_min_datetime": "2019-02-06T15:18:35.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-20T02:07:57.000Z"}
{"max_stars_count": 4287, "max_issues_count": 289, "max_forks_count": 441, "avg_line_length": 28.85, "max_line_length": 67, "alphanum_fraction": 0.6377816291}
import assert from 'assert';

import removeAnchor from './remove-anchor';

describe('removeAnchor(url)', () => {
  it('returns a url w/out #anchor', () => {
    const url = 'http://example.com/foo/bar/wow-cool/page=10/#wow';
    const cleaned = 'http://example.com/foo/bar/wow-cool/page=10';

    assert.equal(removeAnchor(url), cleaned);
  });

  it('returns same url if url has no anchor found', () => {
    const url = 'http://example.com/foo/bar/wow-cool';
    const cleaned = 'http://example.com/foo/bar/wow-cool';

    assert.equal(removeAnchor(url), cleaned);
  });
});
