From 529c544687ba3b7d5ac1f435f66a4c697479802d Mon Sep 17 00:00:00 2001 From: xuexb Date: Tue, 28 Nov 2017 10:44:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20`layui.sort`=20?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=BB=98=E8=AE=A4=E5=80=BC=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/layui.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test/layui.js b/test/layui.js index 9b69142..d0b0214 100644 --- a/test/layui.js +++ b/test/layui.js @@ -346,17 +346,14 @@ describe('layui', function () { ]; it('check params and return value', function () { - // 由于没有值参数, 导致 JSON.parse 失败 - expect(function () { - layui.sort(); - }).to.throw(); + expect(layui.sort()).to.deep.equal([], '空参数时默认为空数组'); - expect(layui.sort({})).to.deep.equal({}); + expect(layui.sort({})).to.deep.equal({}, '只传空对象默认返回'); expect(layui.sort({ name: 'layui' })).to.deep.equal({ name: 'layui' - }); + }, '只传一个对象参数时返回'); expect(layui.sort([{ name: 'layui' From 9ff7d8fce8a3d62da734cd034fff7add52919199 Mon Sep 17 00:00:00 2001 From: xuexb Date: Tue, 28 Nov 2017 10:45:02 +0800 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20=E4=BF=AE=E6=94=B9=E6=B5=8F?= =?UTF-8?q?=E8=A7=88=E5=99=A8=E5=92=8C=20sauce=20=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 817d5a8..ef79766 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ cache: directories: - node_modules script: - - npm run test:cov && npm run test:sauce + - npm run test:cov + - npm run test:sauce after_script: - npm install coveralls && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage