Files
30-seconds-of-code/test/getURLParameters/getURLParameters.test.js
2018-06-18 16:57:55 +03:00

10 lines
415 B
JavaScript

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