Closed MANTENN closed 11 months ago
Created a new repo and this issue is not present in it.
I assume its module resolution, not sure why its not resolving the auth test bindings.
this.application.container.withBindings(['Japa/Preset/ApiRequest', 'Japa/Preset/ApiClient', 'Adonis/Addons/Auth'], (ApiRequest, ApiClient, Auth) => {
const { defineTestsBindings } = require('../src/Bindings/Tests');
console.log('defineTestsBindings')
return defineTestsBindings(ApiRequest, ApiClient, Auth);
});
The callback passed into this.application.container.withBindings
is not run.
Turns out one of the namespaces is missing a binding.
Same exact package version. In a new project, the condition resolves to true.
NODE_ENV=local
was the root cause. didn't notice it in my test file.
Package version
^8.2.3
Node.js and npm version
v16.13.2 & 8.1.2
Sample Code (to reproduce the issue)
default
tests/bootstrap.ts
fileI believe this is the correct spot for opening the issue because the macro is defined here: https://github.com/adonisjs/auth/blob/49228c5b619ba76362ad8ccb2afc9e2f65e83104/src/Bindings/Tests.ts#L49, unless the preset plugin would make more sense: https://github.com/japa/preset-adonis/blob/develop/providers/TestsProvider/index.ts