From 60de4a844aa09a9820c7b0af650c33fe888a9ba9 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Tue, 16 Apr 2019 18:35:49 +0200 Subject: [PATCH] test: add test for query --- __tests__/query.spec.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 __tests__/query.spec.js 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', + }) + }) +}) -- 2.47.3