From 52fcc3cbddd7753acefe6cd1d6eff15430175d61 Mon Sep 17 00:00:00 2001 From: WB20210831001 Date: Wed, 17 Aug 2022 20:31:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/test.spec.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/test.spec.js b/test/test.spec.js index 3417042..c3fa03a 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(5)/* 填空题 */) }) }) }) @@ -21,14 +21,16 @@ describe('assert', function () { } } // 修改下面代码使得满足测试描述 - assert.equal(a, b) + assert.deepEqual(a, b) }) test('可以捕获并验证函数fn的错误', function () { function fn() { - xxx; + // xxx; + throw err; } // 修改下面代码使得满足测试描述 - fn() + + assert.throws(fn,) }) }) \ No newline at end of file