Files
30-seconds-of-code/test/getURLParameters/getURLParameters.test.js
Angelos Chalaris 4f1e8b48b6 Test files linted
2018-08-03 10:39:26 +03:00

13 lines
410 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('http://url.com/page?name=Adam&surname=Smith')).toEqual({
name: 'Adam',
surname: 'Smith'
});
});