From 59e0f9d7bda411c642a44683697ef67404f66162 Mon Sep 17 00:00:00 2001 From: xuexb Date: Mon, 8 Jan 2018 04:29:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20layui.event=20?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/layui.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/layui.js b/test/layui.js index d5dc5fe..0552bd3 100644 --- a/test/layui.js +++ b/test/layui.js @@ -269,9 +269,7 @@ describe('layui', function () { expect(layui.onevent()).to.deep.equal(layui); expect(layui.onevent([], [], [])).to.deep.equal(layui); expect(layui.onevent({}, {}, {})).to.deep.equal(layui); - - var result = layui.onevent('test-' + Date.now(), 'click', function () {}); - expect(result).to.deep.equal(layui); + expect(layui.onevent('test-' + Date.now(), 'click', function () {})).to.not.deep.equal(layui); }); it('bind event', function (done) { @@ -279,8 +277,8 @@ describe('layui', function () { var data = { name: 'layui' }; - var result = layui.onevent(id, 'click', function (param) { - expect(result).to.deep.equal(this).and.equal(layui); + layui.onevent(id, 'click', function (param) { + expect(this).to.deep.equal(layui); expect(param).to.deep.equal(data); done(); });