diff options
author | 2024-02-10 18:19:14 -0700 | |
---|---|---|
committer | 2024-02-13 06:59:44 +0530 | |
commit | 7584d2d7a7110aef0331ebfa178b2295842c59fa (patch) | |
tree | 900cd71237e6231b57936fcce77ff229cd459041 /test.ts | |
parent | upgrade recipes submodule (diff) | |
download | ferdium-server-7584d2d7a7110aef0331ebfa178b2295842c59fa.tar.gz ferdium-server-7584d2d7a7110aef0331ebfa178b2295842c59fa.tar.zst ferdium-server-7584d2d7a7110aef0331ebfa178b2295842c59fa.zip |
refactor: project maintenance
- work in progress
Diffstat (limited to 'test.ts')
-rw-r--r-- | test.ts | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/test.ts b/test.ts deleted file mode 100644 index 65f1348..0000000 --- a/test.ts +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | /* | ||
2 | |-------------------------------------------------------------------------- | ||
3 | | Tests | ||
4 | |-------------------------------------------------------------------------- | ||
5 | | | ||
6 | | The contents in this file boots the AdonisJS application and configures | ||
7 | | the Japa tests runner. | ||
8 | | | ||
9 | | For the most part you will never edit this file. The configuration | ||
10 | | for the tests can be controlled via ".adonisrc.json" and | ||
11 | | "tests/bootstrap.ts" files. | ||
12 | | | ||
13 | */ | ||
14 | |||
15 | import 'reflect-metadata'; | ||
16 | import sourceMapSupport from 'source-map-support'; | ||
17 | import { Ignitor } from '@adonisjs/core/build/standalone'; | ||
18 | import { | ||
19 | configure, | ||
20 | processCliArgs, | ||
21 | run, | ||
22 | RunnerHooksHandler, | ||
23 | } from '@japa/runner'; | ||
24 | |||
25 | process.env.NODE_ENV = 'test'; | ||
26 | |||
27 | sourceMapSupport.install({ handleUncaughtExceptions: false }); | ||
28 | |||
29 | const kernel = new Ignitor(__dirname).kernel('test'); | ||
30 | |||
31 | kernel | ||
32 | .boot() | ||
33 | .then(() => import('./tests/bootstrap')) | ||
34 | .then(({ runnerHooks, ...config }) => { | ||
35 | const app: RunnerHooksHandler[] = [() => kernel.start()]; | ||
36 | |||
37 | configure({ | ||
38 | ...kernel.application.rcFile.tests, | ||
39 | ...processCliArgs(process.argv.slice(2)), | ||
40 | ...config, | ||
41 | |||
42 | importer: filePath => import(filePath), | ||
43 | setup: [...app, ...runnerHooks.setup], | ||
44 | teardown: runnerHooks.teardown, | ||
45 | cwd: kernel.application.appRoot, | ||
46 | }); | ||
47 | |||
48 | run(); | ||
49 | }); | ||