Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
2
test/isAbsoluteURL/isAbsoluteURL.js
Normal file
2
test/isAbsoluteURL/isAbsoluteURL.js
Normal file
@ -0,0 +1,2 @@
|
||||
const isAbsoluteURL = str => /^[a-z][a-z0-9+.-]*:/.test(str);
|
||||
module.exports = isAbsoluteURL;
|
||||
11
test/isAbsoluteURL/isAbsoluteURL.test.js
Normal file
11
test/isAbsoluteURL/isAbsoluteURL.test.js
Normal file
@ -0,0 +1,11 @@
|
||||
const expect = require('expect');
|
||||
const isAbsoluteURL = require('./isAbsoluteURL.js');
|
||||
|
||||
|
||||
test('isAbsoluteURL is a Function', () => {
|
||||
expect(isAbsoluteURL).toBeInstanceOf(Function);
|
||||
});
|
||||
t.equal(isAbsoluteURL('https:
|
||||
t.equal(isAbsoluteURL('ftp:
|
||||
t.equal(isAbsoluteURL('/foo/bar'), false, "Given string is not an absolute URL");
|
||||
|
||||
Reference in New Issue
Block a user