From ceb70e95f6f74c2f4ebd103057bd7501b3fe015f Mon Sep 17 00:00:00 2001 From: MaYuanhai <414199639@qq.com> Date: Fri, 10 Apr 2020 11:35:49 +0800 Subject: [PATCH] Create param2Obj.spec.js param2Obj test --- tests/unit/utils/param2Obj.spec.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/unit/utils/param2Obj.spec.js diff --git a/tests/unit/utils/param2Obj.spec.js b/tests/unit/utils/param2Obj.spec.js new file mode 100644 index 00000000..3bc56ee2 --- /dev/null +++ b/tests/unit/utils/param2Obj.spec.js @@ -0,0 +1,13 @@ +import { param2Obj } from '@/utils/index.js' +describe('Utils:param2Obj', () => { + const url = 'https://github.com/PanJiaChen/vue-element-admin?name=bill&age=29&sex=1&field=dGVzdA==' + + it('param2Obj test', () => { + expect(param2Obj(url)).toEqual({ + name: 'bill', + age: '29', + sex: '1', + field: window.btoa('test') + }) + }) +})