From 19e9cead2150f5740483b7cbee73991fa4d39608 Mon Sep 17 00:00:00 2001 From: zhen <770226915@qq.com> Date: Sat, 20 Aug 2022 15:21:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=96=AD=E8=A8=80=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/test.spec.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/test.spec.js b/test/test.spec.js index 3417042..98b39d9 100644 --- a/test/test.spec.js +++ b/test/test.spec.js @@ -3,7 +3,7 @@ var assert = require('assert') describe('Array', function() { describe('#indexOf()', function() { test('当value不在数组中应当返回-1', function() { - assert.equal(-1, [1, 2, 3]/* 填空题 */) + assert.equal(-1, [1, 2, 3].indexOf(4)/* 填空题 */) }) }) }) @@ -21,7 +21,7 @@ describe('assert', function () { } } // 修改下面代码使得满足测试描述 - assert.equal(a, b) + assert.deepEqual(a, b) }) test('可以捕获并验证函数fn的错误', function () { @@ -29,6 +29,7 @@ describe('assert', function () { xxx; } // 修改下面代码使得满足测试描述 - fn() + // fn() + assert.throws(fn) }) }) \ No newline at end of file