summaryrefslogtreecommitdiffstats
path: root/tests/bootstrap.ts
diff options
context:
space:
mode:
authorLibravatar MCMXC <16797721+mcmxcdev@users.noreply.github.com>2024-02-10 18:37:40 -0700
committerLibravatar Vijay A <vraravam@users.noreply.github.com>2024-02-13 06:59:44 +0530
commite1c47572a6235fd8fd20af888ac3a11c7ae1369d (patch)
tree2dccff36a441916d7014037cef3f7ce84a790cad /tests/bootstrap.ts
parentrefactor: project maintenance (diff)
downloadferdium-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.ts29
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
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 { assert, runFailedTests, specReporter, apiClient } from '@japa/preset-adonis' 10import {
11import { fakeCsrfField } from './utils.js' 11 assert,
12 runFailedTests,
13 specReporter,
14 apiClient,
15} from '@japa/preset-adonis';
16import { 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*/
24export const plugins: Config['plugins'] = [assert(), runFailedTests(), apiClient()] 29export 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*/
36export const reporters: Config['reporters'] = [specReporter()] 45export 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*/
70export const configureSuite: Config['configureSuite'] = (suite) => { 79export 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};