diff --git a/package-lock.json b/package-lock.json index 0a67866..6fb12d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@athenna/http", - "version": "5.35.0", + "version": "5.36.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@athenna/http", - "version": "5.35.0", + "version": "5.36.0", "license": "MIT", "devDependencies": { "@athenna/artisan": "^5.7.0", diff --git a/package.json b/package.json index 1650e52..9aa149e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@athenna/http", - "version": "5.35.0", + "version": "5.36.0", "description": "The Athenna Http server. Built on top of fastify.", "license": "MIT", "author": "João Lenon ", diff --git a/src/testing/plugins/request/TestResponse.ts b/src/testing/plugins/request/TestResponse.ts index 4c84a0e..e0587a6 100644 --- a/src/testing/plugins/request/TestResponse.ts +++ b/src/testing/plugins/request/TestResponse.ts @@ -194,8 +194,8 @@ export class TestResponse extends Macroable { } this.assert.assert( - seenKeys.size, - `The body contains keys: ${keys.join(', ')}` + !seenKeys.size, + `The body contains keys: ${Array.from(seenKeys).join(', ')}` ) } diff --git a/tests/unit/testing/plugins/RequestTest.ts b/tests/unit/testing/plugins/RequestTest.ts index b4abf5b..bf6ca5d 100644 --- a/tests/unit/testing/plugins/RequestTest.ts +++ b/tests/unit/testing/plugins/RequestTest.ts @@ -36,7 +36,7 @@ export default class RequestTest { .header('hello', 'world') .header('helloo', 'worldd') .header('hellooo', 'worlddd') - .send({ hello: 'world', helloo: 'worldd', hellooo: 'worlddd' }) + .send({ hello: 'world', helloo: 'worldd', hellooo: 'worlddd', nested: { hello: 'world' } }) }) Server.get({ @@ -147,10 +147,12 @@ export default class RequestTest { response.assertBodyContains({ hello: 'world' }) response.assertBodyNotContains({ helloooo: 'worldddd' }) response.assertBodyContainsKey('hello') + response.assertBodyContainsKey('nested.hello') response.assertBodyNotContainsKey('helloooo') - response.assertBodyContainsAllKeys(['hello', 'helloo', 'hellooo']) - response.assertBodyNotContainsAllKeys(['helloooo', 'hellooooo', 'helloooooo']) - response.assertBodyDeepEqual({ hello: 'world', helloo: 'worldd', hellooo: 'worlddd' }) + response.assertBodyNotContainsKey('nested.helloooo') + response.assertBodyContainsAllKeys(['hello', 'helloo', 'hellooo', 'nested.hello']) + response.assertBodyNotContainsAllKeys(['helloooo', 'hellooooo', 'helloooooo', 'nested.helloooo']) + response.assertBodyDeepEqual({ hello: 'world', helloo: 'worldd', hellooo: 'worlddd', nested: { hello: 'world' } }) response.assertBodyNotDeepEqual({ helloooo: 'worldddd' }) response.assertHeaderContains({ hello: 'world' }) response.assertHeaderNotContains({ helloooo: 'worldddd' })