Skip to content

Commit 7eeb0c9

Browse files
author
Dom Harrington
committed
Prettier
1 parent 3ca764e commit 7eeb0c9

File tree

2 files changed

+40
-34
lines changed

2 files changed

+40
-34
lines changed

test/construct-payload.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('constructPayload()', () => {
4040
assert.deepEqual(body.request.log.creator, {
4141
name: packageJson.name,
4242
version: packageJson.version,
43-
comment: `${process.platform}/${process.version}`
43+
comment: `${process.platform}/${process.version}`,
4444
});
4545
}));
4646

test/process-response.test.js

+39-33
Original file line numberDiff line numberDiff line change
@@ -15,46 +15,55 @@ function testResponse(assertion, response) {
1515
res.json(response);
1616
});
1717

18-
request(app).post('/').expect(200).end();
18+
request(app)
19+
.post('/')
20+
.expect(200)
21+
.end();
1922
}
2023

2124
describe('processResponse()', () => {
2225
describe.skip('options', () => {
23-
it('should strip blacklisted properties', (done) => {
24-
testResponse((res) => {
25-
assert.deepEqual(
26-
processResponse(res, { blacklist: ['password', 'apiKey'] }).content.text,
27-
JSON.stringify({ another: 'Hello world' }),
28-
);
29-
return done();
30-
}, { password: '123456', apiKey: 'abcdef', another: 'Hello world' });
26+
it('should strip blacklisted properties', done => {
27+
testResponse(
28+
res => {
29+
assert.deepEqual(
30+
processResponse(res, { blacklist: ['password', 'apiKey'] }).content.text,
31+
JSON.stringify({ another: 'Hello world' }),
32+
);
33+
return done();
34+
},
35+
{ password: '123456', apiKey: 'abcdef', another: 'Hello world' },
36+
);
3137
});
3238

33-
it('should only send whitelisted properties', (done) => {
34-
testResponse((res) => {
35-
assert.deepEqual(
36-
processResponse(res, { whitelist: ['password', 'apiKey'] }).content.text,
37-
JSON.stringify({ password: '123456', apiKey: 'abcdef' }),
38-
);
39-
return done();
40-
}, { password: '123456', apiKey: 'abcdef', another: 'Hello world' });
39+
it('should only send whitelisted properties', done => {
40+
testResponse(
41+
res => {
42+
assert.deepEqual(
43+
processResponse(res, { whitelist: ['password', 'apiKey'] }).content.text,
44+
JSON.stringify({ password: '123456', apiKey: 'abcdef' }),
45+
);
46+
return done();
47+
},
48+
{ password: '123456', apiKey: 'abcdef', another: 'Hello world' },
49+
);
4150
});
4251
});
4352

44-
it('#status', (done) =>
45-
testResponse((res) => {
53+
it('#status', done =>
54+
testResponse(res => {
4655
assert.equal(processResponse(res).status, 200);
4756
return done();
4857
}));
4958

50-
it('#statusText', (done) =>
51-
testResponse((res) => {
59+
it('#statusText', done =>
60+
testResponse(res => {
5261
assert.equal(processResponse(res).statusText, 'OK');
5362
return done();
5463
}));
5564

56-
it('#headers', (done) => {
57-
testResponse((res) => {
65+
it('#headers', done => {
66+
testResponse(res => {
5867
assert.deepEqual(processResponse(res).headers.filter(header => header.name !== 'date'), [
5968
{ name: 'x-powered-by', value: 'Express' },
6069
{
@@ -67,26 +76,23 @@ describe('processResponse()', () => {
6776
});
6877

6978
describe('#content', () => {
70-
it('#size', (done) => {
79+
it('#size', done => {
7180
const body = { a: 1, b: 2, c: 3 };
72-
testResponse((res) => {
81+
testResponse(res => {
7382
assert.deepEqual(processResponse(res).content.size, JSON.stringify(body).length);
7483
return done();
7584
}, body);
7685
});
7786

78-
it('#mimeType', (done) =>
79-
testResponse((res) => {
80-
assert.deepEqual(
81-
processResponse(res).content.mimeType,
82-
'application/json; charset=utf-8',
83-
);
87+
it('#mimeType', done =>
88+
testResponse(res => {
89+
assert.deepEqual(processResponse(res).content.mimeType, 'application/json; charset=utf-8');
8490
return done();
8591
}));
8692

87-
it.skip('#text', (done) => {
93+
it.skip('#text', done => {
8894
const body = { a: 1, b: 2, c: 3 };
89-
testResponse((res) => {
95+
testResponse(res => {
9096
assert.deepEqual(processResponse(res).content.text, JSON.stringify(body));
9197
return done();
9298
}, body);

0 commit comments

Comments
 (0)