diff --git a/packages/koa/package.json b/packages/koa/package.json index 8aafb6434ccb8126d38f14f2dccff3ac14b7b5e6..18c2d4219d06bf5b785435f3035a82ed8a73badd 100644 --- a/packages/koa/package.json +++ b/packages/koa/package.json @@ -23,7 +23,7 @@ "test:jwt-auth": "DEBUG=jsonql-koa* ava ./tests/jwt-auth.test.js", "test:fail": "ava ./tests/fail.test.js", "test:contract": "DEBUG=jsonql-koa*,jsonql-contract* ava ./tests/contractWithAuth.test.js", - "test:auth": "DEBUG=jsonql* ava --verbose ./tests/auth.test.js", + "test:auth": "DEBUG=jsonql-koa:test:auth ava --verbose ./tests/auth.test.js", "test:error": "DEBUG=jsonql-koa* ava ./tests/resolverNotFound.test.js", "test:config": "DEBUG=jsonql-koa* ava ./tests/config.test.js", "test:throw": "DEBUG=jsonql-* ava ./tests/throw.test.js", diff --git a/packages/koa/tests/auth.test.js b/packages/koa/tests/auth.test.js index 5b55111a3083a69d98cdaa352c129889dd168dcf..e72c672386f7276d8f148b87e36031eb1ac4afe6 100644 --- a/packages/koa/tests/auth.test.js +++ b/packages/koa/tests/auth.test.js @@ -75,8 +75,10 @@ test.serial('Should cause a JsonqlAuthorisationError if I pass the wrong usernam createQuery('login', ['body-x', myKey]) ); + debug(res.body.error) + t.is(200, res.status) - t.truthy(res.body.error) + t.is('JsonqlAuthorisationError', res.body.error.className) })