jellyfin-web/dashboard-ui/bower_components/query-string/test/extract.js

18 lines
513 B
JavaScript
Raw Normal View History

2016-03-14 13:00:18 -07:00
import test from 'ava';
import fn from '../';
test('should extract query string from url', t => {
t.is(fn.extract('http://foo.bar/?abc=def&hij=klm'), 'abc=def&hij=klm');
t.is(fn.extract('http://foo.bar/?'), '');
});
test('should handle strings not containing query string', t => {
t.is(fn.extract('http://foo.bar/'), '');
t.is(fn.extract(''), '');
});
test('should throw for invalid values', t => {
t.throws(fn.extract.bind(fn, null), TypeError);
t.throws(fn.extract.bind(fn, undefined), TypeError);
});