From 1fd4f908f9cdce51d0fbb3eb4df17435ab5bed74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E4=B8=80=E6=A2=93?= Date: Sun, 23 Jan 2022 01:40:39 +0800 Subject: [PATCH] fix: fixed the broken testcases (#1676) --- .gitignore | 1 + test/basic.js | 2 +- test/node/multipart.js | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 1592c7754..296d7f265 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.vscode build lib-cov coverage.html diff --git a/test/basic.js b/test/basic.js index 9fdb10e19..7c2467514 100644 --- a/test/basic.js +++ b/test/basic.js @@ -100,7 +100,7 @@ describe('request', function () { return Promise.all([request_, request_, request_]).then((results) => { for (const item of results) { - assert.equal( + assert.deepEqual( item.body, results[0].body, 'It should keep returning the same result after being called once' diff --git a/test/node/multipart.js b/test/node/multipart.js index 408bfc012..f4c024883 100644 --- a/test/node/multipart.js +++ b/test/node/multipart.js @@ -114,7 +114,7 @@ describe('Multipart', () => { it('should report ENOENT via the callback', (done) => { request - .post('http://127.0.0.1:1') // nobody is listening there + .post(`${base}/echo`) .attach('name', 'file-does-not-exist') .end((error, res) => { assert.ok(Boolean(error), 'Request should have failed'); @@ -125,7 +125,7 @@ describe('Multipart', () => { it('should report ENOENT via Promise', () => { return request - .post(`http://127.0.0.1:1`) // nobody is listening there + .post(`${base}/echo`) .attach('name', 'file-does-not-exist') .then( (res) => assert.fail('Request should have failed'),