Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
bjarneo committed Jan 21, 2017
1 parent c81921f commit 769e970
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ const urls = [
const expected = [ 'npmjs.com', 'example.com', 'npmjs.com', 'example.org' ];

describe('extract domain', () => {
it('should extract given domain from string', () => {
it('should extract given domain from url', () => {
assert.equal(extractDomain(urls[0]), expected[0]);
assert.equal(extractDomain(urls[1]), expected[1]);
assert.equal(extractDomain(urls[7]), expected[0]);
});

it('should extract given domain from an array of strings', () => {
it('should extract given domain from an array of urls', () => {
const domains = extractDomain(urls);

domains.map(domain => assert(expected.indexOf(domain) > -1));
});

it('should return empty string if it is not a domain', () => {
it('should return empty string if it is not a url', () => {
assert.equal(extractDomain('/i.am/just.astring//7test'), '');
});

Expand Down

0 comments on commit 769e970

Please sign in to comment.