Patch: fix tests
Jérémy Lal
1 year, 9 months ago
0 | Description: fix test failures | |
1 | + Version of follow-redirect module | |
2 | + Mistake in test code | |
3 | Author: Jérémy Lal <kapouer@melix.org> | |
4 | Forwarded: https://github.com/aacerox/node-rest-client/pull/217 | |
5 | Last-Update: 2022-07-27 | |
6 | ||
7 | ||
8 | --- a/test/specs/TestFollowsRedirect.js | |
9 | +++ b/test/specs/TestFollowsRedirect.js | |
10 | @@ -54,7 +54,7 @@ | |
11 | }); | |
12 | ||
13 | req.on('error', function(err){ | |
14 | - err.message.should.be.equal("Max redirects exceeded.") | |
15 | + err.message.should.be.equal("Maximum number of redirects exceeded") | |
16 | done(); | |
17 | }); | |
18 | ||
19 | --- a/test/specs/TestRIOFacade.js | |
20 | +++ b/test/specs/TestRIOFacade.js | |
21 | @@ -263,10 +263,11 @@ | |
22 | ||
23 | var request = client.post(server.baseURL + "/json/path/post",args, function(data, response){ | |
24 | data.postData.should.not.equal(null); | |
25 | - data.postData.should.type("object"); | |
26 | - data.postData.should.have.property("serialized"); | |
27 | - data.postData.serialized.should.be.a.Boolean; | |
28 | - data.postData.serialized.should.be.true; | |
29 | + data.postData.should.type("string"); | |
30 | + const obj = JSON.parse(data.postData); | |
31 | + obj.should.have.property("serialized"); | |
32 | + obj.serialized.should.be.a.Boolean; | |
33 | + obj.serialized.should.be.true; | |
34 | }); | |
35 | ||
36 | done(); | |
37 | @@ -314,4 +315,4 @@ | |
38 | after(function () { | |
39 | server.close(); | |
40 | }); | |
41 | -}); | |
42 | \ No newline at end of file | |
43 | +}); |