Files
30-seconds-of-code/test/getURLParameters.test.js
2018-10-19 20:18:00 +03:00

13 lines
400 B
JavaScript

const expect = require('expect');
const {getURLParameters} = require('./_30s.js');
test('getURLParameters is a Function', () => {
expect(getURLParameters).toBeInstanceOf(Function);
});
test('Returns an object containing the parameters of the current URL', () => {
expect(getURLParameters('http://url.com/page?name=Adam&surname=Smith')).toEqual({
name: 'Adam',
surname: 'Smith'
});
});