diff options
author | 2024-02-10 18:37:40 -0700 | |
---|---|---|
committer | 2024-02-13 06:59:44 +0530 | |
commit | e1c47572a6235fd8fd20af888ac3a11c7ae1369d (patch) | |
tree | 2dccff36a441916d7014037cef3f7ce84a790cad /tests/bootstrap.ts | |
parent | refactor: project maintenance (diff) | |
download | ferdium-server-e1c47572a6235fd8fd20af888ac3a11c7ae1369d.tar.gz ferdium-server-e1c47572a6235fd8fd20af888ac3a11c7ae1369d.tar.zst ferdium-server-e1c47572a6235fd8fd20af888ac3a11c7ae1369d.zip |
updates
Diffstat (limited to 'tests/bootstrap.ts')
-rw-r--r-- | tests/bootstrap.ts | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/tests/bootstrap.ts b/tests/bootstrap.ts index 1c6bea1..521f718 100644 --- a/tests/bootstrap.ts +++ b/tests/bootstrap.ts | |||
@@ -5,10 +5,15 @@ | |||
5 | * file. | 5 | * file. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | import type { Config } from '@japa/runner' | 8 | import type { Config } from '@japa/runner'; |
9 | import TestUtils from '@ioc:Adonis/Core/TestUtils' | 9 | import TestUtils from '@ioc:Adonis/Core/TestUtils'; |
10 | import { assert, runFailedTests, specReporter, apiClient } from '@japa/preset-adonis' | 10 | import { |
11 | import { fakeCsrfField } from './utils.js' | 11 | assert, |
12 | runFailedTests, | ||
13 | specReporter, | ||
14 | apiClient, | ||
15 | } from '@japa/preset-adonis'; | ||
16 | import { fakeCsrfField } from './utils.js'; | ||
12 | 17 | ||
13 | /* | 18 | /* |
14 | |-------------------------------------------------------------------------- | 19 | |-------------------------------------------------------------------------- |
@@ -21,7 +26,11 @@ import { fakeCsrfField } from './utils.js' | |||
21 | | Feel free to remove existing plugins or add more. | 26 | | Feel free to remove existing plugins or add more. |
22 | | | 27 | | |
23 | */ | 28 | */ |
24 | export const plugins: Config['plugins'] = [assert(), runFailedTests(), apiClient()] | 29 | export const plugins: Config['plugins'] = [ |
30 | assert(), | ||
31 | runFailedTests(), | ||
32 | apiClient(), | ||
33 | ]; | ||
25 | 34 | ||
26 | /* | 35 | /* |
27 | |-------------------------------------------------------------------------- | 36 | |-------------------------------------------------------------------------- |
@@ -33,7 +42,7 @@ export const plugins: Config['plugins'] = [assert(), runFailedTests(), apiClient | |||
33 | | of tests on the terminal. | 42 | | of tests on the terminal. |
34 | | | 43 | | |
35 | */ | 44 | */ |
36 | export const reporters: Config['reporters'] = [specReporter()] | 45 | export const reporters: Config['reporters'] = [specReporter()]; |
37 | 46 | ||
38 | /* | 47 | /* |
39 | |-------------------------------------------------------------------------- | 48 | |-------------------------------------------------------------------------- |
@@ -54,7 +63,7 @@ export const runnerHooks: Required<Pick<Config, 'setup' | 'teardown'>> = { | |||
54 | () => fakeCsrfField(), | 63 | () => fakeCsrfField(), |
55 | ], | 64 | ], |
56 | teardown: [], | 65 | teardown: [], |
57 | } | 66 | }; |
58 | 67 | ||
59 | /* | 68 | /* |
60 | |-------------------------------------------------------------------------- | 69 | |-------------------------------------------------------------------------- |
@@ -67,8 +76,8 @@ export const runnerHooks: Required<Pick<Config, 'setup' | 'teardown'>> = { | |||
67 | | You can use this method to configure suites. For example: Only start | 76 | | You can use this method to configure suites. For example: Only start |
68 | | the HTTP server when it is a functional suite. | 77 | | the HTTP server when it is a functional suite. |
69 | */ | 78 | */ |
70 | export const configureSuite: Config['configureSuite'] = (suite) => { | 79 | export const configureSuite: Config['configureSuite'] = suite => { |
71 | if (suite.name === 'functional') { | 80 | if (suite.name === 'functional') { |
72 | suite.setup(() => TestUtils.httpServer().start()) | 81 | suite.setup(() => TestUtils.httpServer().start()); |
73 | } | 82 | } |
74 | } | 83 | }; |