summaryrefslogtreecommitdiffstats
path: root/tests/bootstrap.ts
diff options
context:
space:
mode:
authorLibravatar MCMXC <16797721+mcmxcdev@users.noreply.github.com>2024-02-10 18:19:14 -0700
committerLibravatar Vijay A <vraravam@users.noreply.github.com>2024-02-13 06:59:44 +0530
commit7584d2d7a7110aef0331ebfa178b2295842c59fa (patch)
tree900cd71237e6231b57936fcce77ff229cd459041 /tests/bootstrap.ts
parentupgrade recipes submodule (diff)
downloadferdium-server-7584d2d7a7110aef0331ebfa178b2295842c59fa.tar.gz
ferdium-server-7584d2d7a7110aef0331ebfa178b2295842c59fa.tar.zst
ferdium-server-7584d2d7a7110aef0331ebfa178b2295842c59fa.zip
refactor: project maintenance
- work in progress
Diffstat (limited to 'tests/bootstrap.ts')
-rw-r--r--tests/bootstrap.ts29
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
8import type { Config } from '@japa/runner'; 8import type { Config } from '@japa/runner'
9import TestUtils from '@ioc:Adonis/Core/TestUtils'; 9import TestUtils from '@ioc:Adonis/Core/TestUtils'
10import { 10import { assert, runFailedTests, specReporter, apiClient } from '@japa/preset-adonis'
11 assert, 11import { fakeCsrfField } from './utils.js'
12 runFailedTests,
13 specReporter,
14 apiClient,
15} from '@japa/preset-adonis';
16import { 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*/
29export const plugins: Config['plugins'] = [ 24export 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*/
45export const reporters: Config['reporters'] = [specReporter()]; 36export 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*/
79export const configureSuite: Config['configureSuite'] = suite => { 70export 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}