From ef774dc6c583e215baf29da55ae25a68557f4378 Mon Sep 17 00:00:00 2001 From: Julien Ripouteau Date: Thu, 20 Oct 2022 17:49:57 +0200 Subject: [PATCH] fix: incorrect test/bootstrap typing When strict mode enabled, the types for the differents values exported in bootstrap.txt template was incorrect --- templates/tests/bootstrap.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/tests/bootstrap.txt b/templates/tests/bootstrap.txt index 34a09410..d574211b 100644 --- a/templates/tests/bootstrap.txt +++ b/templates/tests/bootstrap.txt @@ -20,7 +20,7 @@ import { assert, runFailedTests, specReporter, apiClient } from '@japa/preset-ad | Feel free to remove existing plugins or add more. | */ -export const plugins: Config['plugins'] = [assert(), runFailedTests(), apiClient()] +export const plugins: Required['plugins'] = [assert(), runFailedTests(), apiClient()] /* |-------------------------------------------------------------------------- @@ -32,7 +32,7 @@ export const plugins: Config['plugins'] = [assert(), runFailedTests(), apiClient | of tests on the terminal. | */ -export const reporters: Config['reporters'] = [specReporter()] +export const reporters: Required['reporters'] = [specReporter()] /* |-------------------------------------------------------------------------- @@ -46,7 +46,7 @@ export const reporters: Config['reporters'] = [specReporter()] | within the runner hooks | */ -export const runnerHooks: Required> = { +export const runnerHooks: Pick, 'setup' | 'teardown'> = { setup: [() => TestUtils.ace().loadCommands()], teardown: [], } @@ -62,7 +62,7 @@ export const runnerHooks: Required> = { | You can use this method to configure suites. For example: Only start | the HTTP server when it is a functional suite. */ -export const configureSuite: Config['configureSuite'] = (suite) => { +export const configureSuite: Required['configureSuite'] = (suite) => { if (suite.name === 'functional') { suite.setup(() => TestUtils.httpServer().start()) }