projects
/
squeep-api-dingus
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove deprecated ctx.rawBody usage
[squeep-api-dingus]
/
test
/
lib
/
dingus.js
diff --git
a/test/lib/dingus.js
b/test/lib/dingus.js
index b60caca128bc7b839a8291765ac774586556c068..f374ba7d75b042f9bbc99a786c5f4b80016c934b 100644
(file)
--- a/
test/lib/dingus.js
+++ b/
test/lib/dingus.js
@@
-477,14
+477,14
@@
describe('Dingus', function () {
});
it('parses json', function () {
const src = { foo: 'bar' };
});
it('parses json', function () {
const src = { foo: 'bar' };
- c
tx.
rawBody = JSON.stringify(src);
- dingus.parseBody(Enum.ContentType.ApplicationJson, ctx);
+ c
onst
rawBody = JSON.stringify(src);
+ dingus.parseBody(Enum.ContentType.ApplicationJson, ctx
, rawBody
);
assert.deepStrictEqual(ctx.parsedBody, src);
});
it('handles unparsable json', function () {
assert.deepStrictEqual(ctx.parsedBody, src);
});
it('handles unparsable json', function () {
- c
tx.
rawBody = 'not json';
+ c
onst
rawBody = 'not json';
try {
try {
- dingus.parseBody(Enum.ContentType.ApplicationJson, ctx);
+ dingus.parseBody(Enum.ContentType.ApplicationJson, ctx
, rawBody
);
assert.fail(noExpectedException);
} catch (e) {
assert.strictEqual(e.statusCode, 400);
assert.fail(noExpectedException);
} catch (e) {
assert.strictEqual(e.statusCode, 400);
@@
-494,8
+494,8
@@
describe('Dingus', function () {
const expected = Object.assign(Object.create(null), {
foo: 'bar',
});
const expected = Object.assign(Object.create(null), {
foo: 'bar',
});
- c
tx.
rawBody = 'foo=bar';
- dingus.parseBody('application/x-www-form-urlencoded', ctx);
+ c
onst
rawBody = 'foo=bar';
+ dingus.parseBody('application/x-www-form-urlencoded', ctx
, rawBody
);
assert.deepStrictEqual(ctx.parsedBody, expected);
});
assert.deepStrictEqual(ctx.parsedBody, expected);
});