diff options
author | MCMXC <16797721+mcmxcdev@users.noreply.github.com> | 2024-02-10 18:19:14 -0700 |
---|---|---|
committer | Vijay A <vraravam@users.noreply.github.com> | 2024-02-17 21:51:20 +0530 |
commit | a61e73c33b2e80d5af58e3dcfa2efe74245cd065 (patch) | |
tree | d5343ad245b4156662920896dedf14d9284051f8 /tests/bootstrap.ts | |
parent | upgrade node to 20.11.1 and other minor versions for pkgs (#104) (diff) | |
download | ferdium-server-a61e73c33b2e80d5af58e3dcfa2efe74245cd065.tar.gz ferdium-server-a61e73c33b2e80d5af58e3dcfa2efe74245cd065.tar.zst ferdium-server-a61e73c33b2e80d5af58e3dcfa2efe74245cd065.zip |
refactor: project maintenance
- work in progress
Diffstat (limited to 'tests/bootstrap.ts')
-rw-r--r-- | tests/bootstrap.ts | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/tests/bootstrap.ts b/tests/bootstrap.ts index efd1d1f..1c6bea1 100644 --- a/tests/bootstrap.ts +++ b/tests/bootstrap.ts | |||
@@ -5,15 +5,10 @@ | |||
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 { | 10 | import { assert, runFailedTests, specReporter, apiClient } from '@japa/preset-adonis' |
11 | assert, | 11 | import { fakeCsrfField } from './utils.js' |
12 | runFailedTests, | ||
13 | specReporter, | ||
14 | apiClient, | ||
15 | } from '@japa/preset-adonis'; | ||
16 | import { fakeCsrfField } from './utils'; | ||
17 | 12 | ||
18 | /* | 13 | /* |
19 | |-------------------------------------------------------------------------- | 14 | |-------------------------------------------------------------------------- |
@@ -26,11 +21,7 @@ import { fakeCsrfField } from './utils'; | |||
26 | | Feel free to remove existing plugins or add more. | 21 | | Feel free to remove existing plugins or add more. |
27 | | | 22 | | |
28 | */ | 23 | */ |
29 | export const plugins: Config['plugins'] = [ | 24 | export const plugins: Config['plugins'] = [assert(), runFailedTests(), apiClient()] |
30 | assert(), | ||
31 | runFailedTests(), | ||
32 | apiClient(), | ||
33 | ]; | ||
34 | 25 | ||
35 | /* | 26 | /* |
36 | |-------------------------------------------------------------------------- | 27 | |-------------------------------------------------------------------------- |
@@ -42,7 +33,7 @@ export const plugins: Config['plugins'] = [ | |||
42 | | of tests on the terminal. | 33 | | of tests on the terminal. |
43 | | | 34 | | |
44 | */ | 35 | */ |
45 | export const reporters: Config['reporters'] = [specReporter()]; | 36 | export const reporters: Config['reporters'] = [specReporter()] |
46 | 37 | ||
47 | /* | 38 | /* |
48 | |-------------------------------------------------------------------------- | 39 | |-------------------------------------------------------------------------- |
@@ -63,7 +54,7 @@ export const runnerHooks: Required<Pick<Config, 'setup' | 'teardown'>> = { | |||
63 | () => fakeCsrfField(), | 54 | () => fakeCsrfField(), |
64 | ], | 55 | ], |
65 | teardown: [], | 56 | teardown: [], |
66 | }; | 57 | } |
67 | 58 | ||
68 | /* | 59 | /* |
69 | |-------------------------------------------------------------------------- | 60 | |-------------------------------------------------------------------------- |
@@ -76,8 +67,8 @@ export const runnerHooks: Required<Pick<Config, 'setup' | 'teardown'>> = { | |||
76 | | You can use this method to configure suites. For example: Only start | 67 | | You can use this method to configure suites. For example: Only start |
77 | | the HTTP server when it is a functional suite. | 68 | | the HTTP server when it is a functional suite. |
78 | */ | 69 | */ |
79 | export const configureSuite: Config['configureSuite'] = suite => { | 70 | export const configureSuite: Config['configureSuite'] = (suite) => { |
80 | if (suite.name === 'functional') { | 71 | if (suite.name === 'functional') { |
81 | suite.setup(() => TestUtils.httpServer().start()); | 72 | suite.setup(() => TestUtils.httpServer().start()) |
82 | } | 73 | } |
83 | }; | 74 | } |