diff --git a/package-lock.json b/package-lock.json index 593e270..aa50eb6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,27 +1,27 @@ { "name": "@athenna/core", - "version": "4.22.0", + "version": "4.23.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@athenna/core", - "version": "4.22.0", + "version": "4.23.0", "license": "MIT", "dependencies": { "pretty-repl": "^3.1.2", "semver": "^7.5.4" }, "devDependencies": { - "@athenna/artisan": "^4.27.0", - "@athenna/common": "^4.26.0", - "@athenna/config": "^4.11.0", - "@athenna/http": "^4.16.0", - "@athenna/ioc": "^4.12.0", - "@athenna/logger": "^4.13.0", - "@athenna/test": "^4.17.0", + "@athenna/artisan": "^4.28.0", + "@athenna/common": "^4.27.0", + "@athenna/config": "^4.12.0", + "@athenna/http": "^4.17.0", + "@athenna/ioc": "^4.13.0", + "@athenna/logger": "^4.14.0", + "@athenna/test": "^4.18.0", "@athenna/tsconfig": "^4.12.0", - "@athenna/view": "^4.10.0", + "@athenna/view": "^4.11.0", "@typescript-eslint/eslint-plugin": "^6.7.4", "@typescript-eslint/parser": "^6.7.4", "commitizen": "^4.2.6", @@ -97,9 +97,9 @@ "dev": true }, "node_modules/@athenna/artisan": { - "version": "4.27.0", - "resolved": "https://registry.npmjs.org/@athenna/artisan/-/artisan-4.27.0.tgz", - "integrity": "sha512-5WWAinUVo7A0UrW0yGvNCZlpW3ovdmDOTeHxFEN2f8Fgtut63bG9zjDt6iWUlHzK/Xq2rdNgGPKJ+z4CCONsSQ==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/@athenna/artisan/-/artisan-4.28.0.tgz", + "integrity": "sha512-TnmFTSs+JbKIvPe0+NVSlQ+LgnDCiOE8mR6b7GwR8GPq5QRTKwCVDprfufHfhmUd4TzDTOUFVTFT8KdFvK/lJA==", "dev": true, "dependencies": { "chalk-rainbow": "^1.0.0", @@ -117,9 +117,9 @@ } }, "node_modules/@athenna/common": { - "version": "4.26.0", - "resolved": "https://registry.npmjs.org/@athenna/common/-/common-4.26.0.tgz", - "integrity": "sha512-iU8lXqoiFJS6Iyh+oL8DL+72sZx6CS9PibZ/Bw+cKogaUULdF+wdWGFlaWrap61HzS1vFd3u1EZi3Y/49SsBGg==", + "version": "4.27.0", + "resolved": "https://registry.npmjs.org/@athenna/common/-/common-4.27.0.tgz", + "integrity": "sha512-/3nmLppFUj9qZiWgC2m60ctV677cSr1w1qsJDP7i8uMsaDUgobCa90+5odP7FUryIXGqgvriI1fUQMSaEcDuUw==", "dev": true, "dependencies": { "@fastify/formbody": "^7.4.0", @@ -129,7 +129,7 @@ "change-case": "^4.1.2", "collect.js": "^4.36.1", "execa": "^8.0.1", - "fastify": "^4.25.0", + "fastify": "^4.25.1", "got": "^12.6.1", "http-status-codes": "^2.2.0", "is-wsl": "^2.2.0", @@ -170,9 +170,9 @@ } }, "node_modules/@athenna/config": { - "version": "4.11.0", - "resolved": "https://registry.npmjs.org/@athenna/config/-/config-4.11.0.tgz", - "integrity": "sha512-n98HrUJ8/8bK6L4jLS924Z35zAUZyzNbDo7V1wOXNGXF4yEWVZ15M/lSrfsrczXGlKvwC40BR9JPmSPNosl//Q==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@athenna/config/-/config-4.12.0.tgz", + "integrity": "sha512-55eLPAIi3eoNsih5gRqqnR0Wr5WlYCEchOd9U8UZYe0LbbhVl1+sWuGqmhBI29KHrZ4g32KhwqAzXiB0dwkHsg==", "dev": true, "dependencies": { "dotenv": "^16.3.1", @@ -184,18 +184,18 @@ } }, "node_modules/@athenna/http": { - "version": "4.16.0", - "resolved": "https://registry.npmjs.org/@athenna/http/-/http-4.16.0.tgz", - "integrity": "sha512-I6qU+gHla6F9c8MrXcaQBTSKLMtF8L1le3L39eR/A/2yk3faXkxDXEmziEJxyGTswqlOA/OV3NZ3p5pI6IECwA==", + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@athenna/http/-/http-4.17.0.tgz", + "integrity": "sha512-F5774jY8PERvkaF+WoWjNzxYYxLdJhqgGoLJIs8dqS19dIJPmyjC57AalqCpGVZNun/o/37vXSRAWHGDoeLVpg==", "dev": true, "engines": { "node": ">=20.0.0" } }, "node_modules/@athenna/ioc": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@athenna/ioc/-/ioc-4.12.0.tgz", - "integrity": "sha512-Avg785spk2qG9pBr/jZv+jqExV2cKESECWTQOAzeCFGljsRsWjMB4K8tGiVyUejEIlc8aAcqSFXZDUGOdCz6zg==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@athenna/ioc/-/ioc-4.13.0.tgz", + "integrity": "sha512-bLv8ZKXRdi7POFK9Ui1GqsA/AQsKuP2BSww1g7YUjfpunsSSKQXP/iRGWTBuDidWapaTNScwb5jTeFCPMh31pQ==", "dev": true, "dependencies": { "awilix": "^7.0.3" @@ -205,9 +205,9 @@ } }, "node_modules/@athenna/logger": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@athenna/logger/-/logger-4.13.0.tgz", - "integrity": "sha512-7QVvaGnyReXKQcbuaojkHzbshTGAAsFCP2wGawSaD8ErADD2kkBSolsCtw+3/FYyyf/x0vDo/+y8bJP56L0y5A==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/@athenna/logger/-/logger-4.14.0.tgz", + "integrity": "sha512-yXCd2nmDtLbXxHC6bhPduKwYnBwxE+s6zt0sWYTw11oY9ZL8QByv01f6Z+EVRjpSJDXqlYVzFs8195Og2GPfeQ==", "dev": true, "dependencies": { "cls-rtracer": "^2.6.3", @@ -218,9 +218,9 @@ } }, "node_modules/@athenna/test": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/@athenna/test/-/test-4.17.0.tgz", - "integrity": "sha512-NRYXxjDf8+owgUZmrp217L68E4oVI7lnHEAohsAtKuwjPvqXtTxDKLYO8AviB+QOPo0zUFr6X0mMkNVGLH5MCA==", + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@athenna/test/-/test-4.18.0.tgz", + "integrity": "sha512-HpW6XFZ5GqAd31mj2FB9H7eiBe+Wx/3DAEbiFcaf9JhGoi20GstbS2Bno4YAKv84NxsaLJgJxMZExjonu/uSuw==", "dev": true, "dependencies": { "@japa/assert": "^2.1.0", @@ -249,9 +249,9 @@ } }, "node_modules/@athenna/view": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@athenna/view/-/view-4.10.0.tgz", - "integrity": "sha512-QZRbJaH2d+D8SOsm5RUMhw+BtAX1l02j309s7nowruDcUK5tBoqYVFECRPa4cKeIb87X8IFSquz1jNM26HW3KA==", + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/@athenna/view/-/view-4.11.0.tgz", + "integrity": "sha512-RC1pz2KitX1Ig99zcHlu3DxVT6LTZ94K1zL6TubRbwi7DM/WPUwyG7UiLefAaG3rM4mWozt/vE/lBj8yaRkiuA==", "dev": true, "dependencies": { "edge.js": "^5.5.1" diff --git a/package.json b/package.json index a5f7f04..bcb8558 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@athenna/core", - "version": "4.22.0", + "version": "4.23.0", "description": "The plug and play Node.js framework.", "license": "MIT", "author": "João Lenon ", @@ -76,15 +76,15 @@ "semver": "^7.5.4" }, "devDependencies": { - "@athenna/artisan": "^4.27.0", - "@athenna/common": "^4.26.0", - "@athenna/config": "^4.11.0", - "@athenna/http": "^4.16.0", - "@athenna/ioc": "^4.12.0", - "@athenna/logger": "^4.13.0", - "@athenna/test": "^4.17.0", + "@athenna/artisan": "^4.28.0", + "@athenna/common": "^4.27.0", + "@athenna/config": "^4.12.0", + "@athenna/http": "^4.17.0", + "@athenna/ioc": "^4.13.0", + "@athenna/logger": "^4.14.0", + "@athenna/test": "^4.18.0", "@athenna/tsconfig": "^4.12.0", - "@athenna/view": "^4.10.0", + "@athenna/view": "^4.11.0", "@typescript-eslint/eslint-plugin": "^6.7.4", "@typescript-eslint/parser": "^6.7.4", "commitizen": "^4.2.6", diff --git a/tests/unit/applications/ConsoleTest.ts b/tests/unit/applications/ConsoleTest.ts index 83718e4..c79944d 100644 --- a/tests/unit/applications/ConsoleTest.ts +++ b/tests/unit/applications/ConsoleTest.ts @@ -32,12 +32,12 @@ export default class ConsoleTest { @Test() public async shouldBeAbleToBootAConsoleApplicationInYourEntrypoint({ assert }: Context) { - const parseMock = Artisan.when('parse').resolve(undefined) + Artisan.when('parse').resolve(undefined) const argv = ['node', 'artisan'] await Console.boot(argv) - assert.calledOnceWith(parseMock, argv, null) + assert.calledOnceWith(Artisan.parse, argv, null) assert.isTrue(CommanderHandler.hasCommand('test')) assert.isTrue(CommanderHandler.hasCommand('repl')) assert.isTrue(CommanderHandler.hasCommand('build')) @@ -46,12 +46,12 @@ export default class ConsoleTest { @Test() public async shouldBeAbleToBootAConsoleApplicationByCommandOfArgv({ assert }: Context) { - const parseMock = Artisan.when('parse').resolve(undefined) + Artisan.when('parse').resolve(undefined) const argv = ['node', 'artisan', 'test'] await Console.boot(argv) - assert.calledOnceWith(parseMock, argv, null) + assert.calledOnceWith(Artisan.parse, argv, null) assert.isTrue(CommanderHandler.hasCommand('test')) assert.isFalse(CommanderHandler.hasCommand('repl')) assert.isFalse(CommanderHandler.hasCommand('build')) @@ -60,49 +60,49 @@ export default class ConsoleTest { @Test() public async shouldBeAbleToBootAConsoleApplicationWithADisplayName({ assert }: Context) { - const parseMock = Artisan.when('parse').resolve(undefined) + Artisan.when('parse').resolve(undefined) const argv = ['node', 'artisan', 'test'] await Console.boot(argv, { displayName: 'Artisan' }) - assert.calledOnceWith(parseMock, argv, 'Artisan') + assert.calledOnceWith(Artisan.parse, argv, 'Artisan') assert.isTrue(CommanderHandler.hasCommand('test')) } @Test() public async shouldBeAbleToBootAConsoleApplicationWithADifferentRoutePath({ assert }: Context) { - const parseMock = Artisan.when('parse').resolve(undefined) + Artisan.when('parse').resolve(undefined) const argv = ['node', 'artisan'] await Console.boot(argv, { routePath: Path.fixtures('routes/console.ts') }) - assert.calledOnceWith(parseMock, argv, null) + assert.calledOnceWith(Artisan.parse, argv, null) assert.isTrue(CommanderHandler.hasCommand('route:console')) } @Test() public async shouldBeAbleToBootAConsoleApplicationWithADifferentKernelPath({ assert }: Context) { - const infoMock = Log.when('info').return(undefined) - const parseMock = Artisan.when('parse').resolve(undefined) + Log.when('info').return(undefined) + Artisan.when('parse').resolve(undefined) const argv = ['node', 'artisan'] await Console.boot(argv, { kernelPath: Path.fixtures('kernels/CustomConsoleKernel.ts') }) - assert.calledOnceWith(parseMock, argv, null) - assert.calledOnceWith(infoMock, 'importing CustomConsoleKernel') + assert.calledOnceWith(Artisan.parse, argv, null) + assert.calledOnceWith(Log.info, 'importing CustomConsoleKernel') assert.isTrue(CommanderHandler.hasCommand('test')) } @Test() public async shouldBeAbleToBootAConsoleApplicationWithADifferentExceptionHandlerPath({ assert }: Context) { - const infoMock = Log.when('info').return(undefined) - const parseMock = Artisan.when('parse').resolve(undefined) + Log.when('info').return(undefined) + Artisan.when('parse').resolve(undefined) const argv = ['node', 'artisan'] await Console.boot(argv, { exceptionHandlerPath: Path.fixtures('handlers/CustomConsoleExceptionHandler.ts') }) - assert.calledOnceWith(parseMock, argv, null) - assert.calledOnceWith(infoMock, 'importing CustomConsoleExceptionHandler') + assert.calledOnceWith(Artisan.parse, argv, null) + assert.calledOnceWith(Log.info, 'importing CustomConsoleExceptionHandler') assert.isTrue(CommanderHandler.hasCommand('test')) } @@ -113,12 +113,12 @@ export default class ConsoleTest { Log.when('channelOrVanilla').return({ success: successMock }) - const parseMock = Artisan.when('parse').resolve(undefined) + Artisan.when('parse').resolve(undefined) const argv = ['node', 'artisan'] await Console.boot(argv) - assert.calledOnceWith(parseMock, argv, null) + assert.calledOnceWith(Artisan.parse, argv, null) assert.calledWith(successMock, 'Kernel ({yellow} ConsoleKernel) successfully booted') assert.isTrue(CommanderHandler.hasCommand('test')) } diff --git a/tests/unit/applications/HttpTest.ts b/tests/unit/applications/HttpTest.ts index 82c4351..e0a615c 100644 --- a/tests/unit/applications/HttpTest.ts +++ b/tests/unit/applications/HttpTest.ts @@ -34,73 +34,73 @@ export default class HttpTest { @Test() public async shouldBeAbleToBootAHttpApplication({ assert }: Context) { - const listenMock = Server.when('listen').resolve(undefined) + Server.when('listen').resolve(undefined) await Http.boot() - assert.calledOnceWith(listenMock, { host: '127.0.0.1', port: 3000 }) + assert.calledOnceWith(Server.listen, { host: '127.0.0.1', port: 3000 }) } @Test() public async shouldBeAbleToBootAHttpApplicationWithDifferentHost({ assert }: Context) { - const listenMock = Server.when('listen').resolve(undefined) + Server.when('listen').resolve(undefined) await Http.boot({ host: '0.0.0.0' }) - assert.calledOnceWith(listenMock, { host: '0.0.0.0', port: 3000 }) + assert.calledOnceWith(Server.listen, { host: '0.0.0.0', port: 3000 }) } @Test() public async shouldBeAbleToBootAHttpApplicationWithDifferentPort({ assert }: Context) { - const listenMock = Server.when('listen').resolve(undefined) + Server.when('listen').resolve(undefined) await Http.boot({ port: 3001 }) - assert.calledOnceWith(listenMock, { host: '127.0.0.1', port: 3001 }) + assert.calledOnceWith(Server.listen, { host: '127.0.0.1', port: 3001 }) } @Test() public async shouldBeAbleToBootAHttpApplicationWithDifferentHttpKernel({ assert }: Context) { - const infoMock = Log.when('info').return(undefined) - const listenMock = Server.when('listen').resolve(undefined) + Log.when('info').return(undefined) + Server.when('listen').resolve(undefined) await Http.boot({ kernelPath: Path.fixtures('kernels/CustomHttpKernel.ts') }) - assert.calledOnceWith(infoMock, 'importing CustomHttpKernel') - assert.calledOnceWith(listenMock, { host: '127.0.0.1', port: 3000 }) + assert.calledOnceWith(Log.info, 'importing CustomHttpKernel') + assert.calledOnceWith(Server.listen, { host: '127.0.0.1', port: 3000 }) } @Test() public async shouldBeAbleToBootAHttpApplicationWithDifferentExceptionHandler({ assert }: Context) { - const infoMock = Log.when('info').return(undefined) - const listenMock = Server.when('listen').resolve(undefined) + Log.when('info').return(undefined) + Server.when('listen').resolve(undefined) await Http.boot({ exceptionHandlerPath: Path.fixtures('handlers/CustomHttpExceptionHandler.ts') }) - assert.calledOnceWith(infoMock, 'importing CustomHttpExceptionHandler') - assert.calledOnceWith(listenMock, { host: '127.0.0.1', port: 3000 }) + assert.calledOnceWith(Log.info, 'importing CustomHttpExceptionHandler') + assert.calledOnceWith(Server.listen, { host: '127.0.0.1', port: 3000 }) } @Test() public async shouldBeAbleToBootAHttpApplicationWithTracingPluginRegistered({ assert }: Context) { - const registerRTraceMock = Mock.when(HttpKernel.prototype, 'registerRTracer').resolve(undefined) - const listenMock = Server.when('listen').resolve(undefined) + Mock.when(HttpKernel.prototype, 'registerRTracer').resolve(undefined) + Server.when('listen').resolve(undefined) await Http.boot({ trace: true }) - assert.calledOnceWith(listenMock, { host: '127.0.0.1', port: 3000 }) - assert.calledOnceWith(registerRTraceMock, true) + assert.calledOnceWith(Server.listen, { host: '127.0.0.1', port: 3000 }) + assert.calledOnceWith(HttpKernel.prototype.registerRTracer, true) } @Test() public async shouldBeAbleToBootAHttpApplicationAndRegisterTheRouteFile({ assert }: Context) { - const listenMock = Server.when('listen').resolve(undefined) + Server.when('listen').resolve(undefined) assert.isFalse(Server.getRoutes().includes('└── / (GET, HEAD)')) await Http.boot({ routePath: Path.fixtures('routes/rest.ts') }) - assert.calledOnceWith(listenMock, { host: '127.0.0.1', port: 3000 }) + assert.calledOnceWith(Server.listen, { host: '127.0.0.1', port: 3000 }) assert.isTrue(Server.getRoutes().includes('└── / (GET, HEAD)')) } @@ -111,11 +111,11 @@ export default class HttpTest { Log.when('channelOrVanilla').return({ success: successMock }) - const listenMock = Server.when('listen').resolve(undefined) + Server.when('listen').resolve(undefined) await Http.boot() - assert.calledOnceWith(listenMock, { host: '127.0.0.1', port: 3000 }) + assert.calledOnceWith(Server.listen, { host: '127.0.0.1', port: 3000 }) assert.calledWith(successMock, 'Http server started on ({yellow} 127.0.0.1:3000)') assert.calledWith(successMock, 'Kernel ({yellow} HttpKernel) successfully booted') } @@ -127,11 +127,11 @@ export default class HttpTest { Log.when('channelOrVanilla').return({ success: successMock }) - const listenMock = Server.when('listen').resolve(undefined) + Server.when('listen').resolve(undefined) await Http.boot({ host: 'athenna.io' }) - assert.calledOnceWith(listenMock, { host: 'athenna.io', port: 3000 }) + assert.calledOnceWith(Server.listen, { host: 'athenna.io', port: 3000 }) assert.calledWith(successMock, 'Http server started on ({yellow} athenna.io)') assert.calledWith(successMock, 'Kernel ({yellow} HttpKernel) successfully booted') } @@ -143,11 +143,11 @@ export default class HttpTest { Log.when('channelOrVanilla').return({ success: successMock }) - const listenMock = Server.when('listen').resolve(undefined) + Server.when('listen').resolve(undefined) await Http.boot({ host: '::1' }) - assert.calledOnceWith(listenMock, { host: '::1', port: 3000 }) + assert.calledOnceWith(Server.listen, { host: '::1', port: 3000 }) assert.calledWith(successMock, 'Http server started on ({yellow} localhost:3000)') assert.calledWith(successMock, 'Kernel ({yellow} HttpKernel) successfully booted') } diff --git a/tests/unit/applications/ReplTest.ts b/tests/unit/applications/ReplTest.ts index 4e2ec14..211e25e 100644 --- a/tests/unit/applications/ReplTest.ts +++ b/tests/unit/applications/ReplTest.ts @@ -39,10 +39,10 @@ export default class ReplTest { public async shouldBeAbleToBootAReplApplication({ assert }: Context) { Mock.when(process.stdout, 'write').return(undefined) Repl.when('start').resolve(undefined) - Repl.when('write').return(Repl) - Repl.when('setPrompt').return(Repl) - Repl.when('displayPrompt').return(Repl) - Repl.when('commandImpl').return(Repl) + Repl.when('write').returnThis() + Repl.when('setPrompt').returnThis() + Repl.when('displayPrompt').returnThis() + Repl.when('commandImpl').returnThis() await ReplApp.boot() @@ -53,11 +53,11 @@ export default class ReplTest { public async shouldBeAbleToBootAReplApplicationAndSeeTheReplStartupLogs({ assert }: Context) { Mock.when(process.stdout, 'write').return(undefined) Repl.when('start').resolve(undefined) - Repl.when('write').return(Repl) - Repl.when('setPrompt').return(Repl) - Repl.when('displayPrompt').return(Repl) - Repl.when('commandImpl').return(Repl) - Repl.when('shutdownProviders').return(Repl) + Repl.when('write').returnThis() + Repl.when('setPrompt').returnThis() + Repl.when('displayPrompt').returnThis() + Repl.when('commandImpl').returnThis() + Repl.when('shutdownProviders').returnThis() await ReplApp.boot() @@ -71,11 +71,11 @@ export default class ReplTest { public async shouldBeAbleToBootAReplApplicationAndDeleteTheDomainErrorHandler({ assert }: Context) { Mock.when(process.stdout, 'write').return(undefined) Repl.when('start').resolve(undefined) - Repl.when('write').return(Repl) - Repl.when('setPrompt').return(Repl) - Repl.when('displayPrompt').return(Repl) - Repl.when('commandImpl').return(Repl) - Repl.when('shutdownProviders').return(Repl) + Repl.when('write').returnThis() + Repl.when('setPrompt').returnThis() + Repl.when('displayPrompt').returnThis() + Repl.when('commandImpl').returnThis() + Repl.when('shutdownProviders').returnThis() await ReplApp.boot() @@ -87,11 +87,11 @@ export default class ReplTest { public async shouldBeAbleToBootAReplApplicationAndRegisterTheLsCommand({ assert }: Context) { Mock.when(process.stdout, 'write').return(undefined) Repl.when('start').resolve(undefined) - Repl.when('write').return(Repl) - Repl.when('setPrompt').return(Repl) - Repl.when('displayPrompt').return(Repl) - Repl.when('commandImpl').return(Repl) - Repl.when('shutdownProviders').return(Repl) + Repl.when('write').returnThis() + Repl.when('setPrompt').returnThis() + Repl.when('displayPrompt').returnThis() + Repl.when('commandImpl').returnThis() + Repl.when('shutdownProviders').returnThis() await ReplApp.boot() diff --git a/tests/unit/helpers/LoadHelperTest.ts b/tests/unit/helpers/LoadHelperTest.ts index 5196c43..95bae12 100644 --- a/tests/unit/helpers/LoadHelperTest.ts +++ b/tests/unit/helpers/LoadHelperTest.ts @@ -154,7 +154,7 @@ export default class LoadHelperTest { Config.set('rc.shutdownLogs', true) const successFake = Mock.fake() - const mock = Log.when('channelOrVanilla').return({ + Log.when('channelOrVanilla').return({ success: successFake }) @@ -166,7 +166,7 @@ export default class LoadHelperTest { assert.calledWith(successFake, 'Provider ({yellow} WorkerEnvProvider) successfully shutdown') assert.calledWith(successFake, 'Provider ({yellow} ConsoleEnvProvider) successfully shutdown') assert.calledWith(successFake, 'Provider ({yellow} HttpAndConsoleEnvProvider) successfully shutdown') - assert.calledTimesWith(mock, 5, 'application') + assert.calledTimesWith(Log.channelOrVanilla, 5, 'application') } @Test() @@ -190,7 +190,7 @@ export default class LoadHelperTest { Config.set('rc.bootLogs', true) const successFake = Mock.fake() - const mock = Log.when('channelOrVanilla').return({ + Log.when('channelOrVanilla').return({ success: successFake }) @@ -201,8 +201,7 @@ export default class LoadHelperTest { assert.calledWith(successFake, 'Provider ({yellow} WorkerEnvProvider) successfully booted') assert.calledWith(successFake, 'Provider ({yellow} ConsoleEnvProvider) successfully booted') assert.calledWith(successFake, 'Provider ({yellow} HttpAndConsoleEnvProvider) successfully booted') - - assert.calledTimesWith(mock, 5, 'application') + assert.calledTimesWith(Log.channelOrVanilla, 5, 'application') } @Test() @@ -220,13 +219,13 @@ export default class LoadHelperTest { Config.set('rc.preloads', ['#tests/fixtures/routes/load']) const successFake = Mock.fake() - const mock = Log.when('channelOrVanilla').return({ + Log.when('channelOrVanilla').return({ success: successFake }) await LoadHelper.preloadFiles() - assert.calledTimesWith(mock, 1, 'application') + assert.calledTimesWith(Log.channelOrVanilla, 1, 'application') assert.calledWith(successFake, 'File ({yellow} load) successfully preloaded') }