From 9e8201210471f5e69bfdea4b4e270e0ef0c5d249 Mon Sep 17 00:00:00 2001 From: wengjiacheng <15652115994@163.com> Date: Sun, 21 Aug 2022 20:56:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A1=A5=E5=85=A8=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/test.spec.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/test.spec.js b/test/test.spec.js index 3417042..1530e10 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,14 +21,19 @@ describe('assert', function () { } } // 修改下面代码使得满足测试描述 - assert.equal(a, b) + assert.deepEqual(a, b) }) test('可以捕获并验证函数fn的错误', function () { function fn() { xxx; } - // 修改下面代码使得满足测试描述 - fn() + try { + // 修改下面代码使得满足测试描述 + fn() + } catch (error) { + console.log(error) + } + }) }) \ No newline at end of file