From: Eduardo San Martin Morote Date: Tue, 16 Apr 2019 16:35:49 +0000 (+0200) Subject: test: add test for query X-Git-Tag: v4.0.0-alpha.0~436 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60de4a844aa09a9820c7b0af650c33fe888a9ba9;p=thirdparty%2Fvuejs%2Frouter.git test: add test for query --- diff --git a/__tests__/query.spec.js b/__tests__/query.spec.js new file mode 100644 index 00000000..fe561dbb --- /dev/null +++ b/__tests__/query.spec.js @@ -0,0 +1,18 @@ +// @ts-check +require('./helper') +const expect = require('expect') +const { parseQuery } = require('../src/history/utils') + +describe('parseQuery', () => { + it('works with leading ?', () => { + expect(parseQuery('?foo=a')).toEqual({ + foo: 'a', + }) + }) + + it('works without leading ?', () => { + expect(parseQuery('foo=a')).toEqual({ + foo: 'a', + }) + }) +})