From aee58c55c2906d45a32a83acffc0d7462a067911 Mon Sep 17 00:00:00 2001 From: Leopen <790480953@qq.com> Date: Sat, 20 Aug 2022 14:06:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=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 | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/test/test.spec.js b/test/test.spec.js index 3417042..beff285 100644 --- a/test/test.spec.js +++ b/test/test.spec.js @@ -1,34 +1,34 @@ var assert = require('assert') -describe('Array', function() { - describe('#indexOf()', function() { - test('当value不在数组中应当返回-1', function() { - assert.equal(-1, [1, 2, 3]/* 填空题 */) - }) - }) -}) +describe("Array", function () { + describe("#indexOf()", function () { + test("当value不在数组中应当返回-1", function () { + assert.equal(-1, [1, 2, 3].indexOf(0) /* 填空题 */); + }); + }); +}); -describe('assert', function () { - test('a和b应当深度相等', function () { +describe("assert", function () { + test("a和b应当深度相等", function () { var a = { c: { - e: 1 - } - } + e: 1, + }, + }; var b = { c: { - e: 1 - } - } + e: 1, + }, + }; // 修改下面代码使得满足测试描述 - assert.equal(a, b) - }) + assert.deepEqual(a, b); + }); - test('可以捕获并验证函数fn的错误', function () { + test("可以捕获并验证函数fn的错误", function () { function fn() { xxx; } // 修改下面代码使得满足测试描述 - fn() - }) -}) \ No newline at end of file + assert.throws(fn); + }); +}); \ No newline at end of file From edd6426332209e97276c4162c095796f42e941d7 Mon Sep 17 00:00:00 2001 From: Leopen <790480953@qq.com> Date: Sat, 20 Aug 2022 14:15:33 +0800 Subject: [PATCH 2/2] =?UTF-8?q?style:=20=E6=A0=BC=E5=BC=8F=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=EF=BC=8C=E4=BD=BF=E7=94=A8=E5=8D=95=E5=BC=95=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/test.spec.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/test.spec.js b/test/test.spec.js index beff285..8608f73 100644 --- a/test/test.spec.js +++ b/test/test.spec.js @@ -1,15 +1,15 @@ -var assert = require('assert') +var assert = require('assert'); -describe("Array", function () { - describe("#indexOf()", function () { - test("当value不在数组中应当返回-1", function () { +describe('Array', function () { + describe('#indexOf()', function () { + test('当value不在数组中应当返回-1', function () { assert.equal(-1, [1, 2, 3].indexOf(0) /* 填空题 */); }); }); }); -describe("assert", function () { - test("a和b应当深度相等", function () { +describe('assert', function () { + test('a和b应当深度相等', function () { var a = { c: { e: 1, @@ -24,11 +24,11 @@ describe("assert", function () { assert.deepEqual(a, b); }); - test("可以捕获并验证函数fn的错误", function () { + test('可以捕获并验证函数fn的错误', function () { function fn() { xxx; } // 修改下面代码使得满足测试描述 assert.throws(fn); }); -}); \ No newline at end of file +});