aboutsummaryrefslogtreecommitdiffstats
path: root/test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test.ts')
-rw-r--r--test.ts49
1 files changed, 49 insertions, 0 deletions
diff --git a/test.ts b/test.ts
new file mode 100644
index 0000000..65f1348
--- /dev/null
+++ b/test.ts
@@ -0,0 +1,49 @@
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
15import 'reflect-metadata';
16import sourceMapSupport from 'source-map-support';
17import { Ignitor } from '@adonisjs/core/build/standalone';
18import {
19 configure,
20 processCliArgs,
21 run,
22 RunnerHooksHandler,
23} from '@japa/runner';
24
25process.env.NODE_ENV = 'test';
26
27sourceMapSupport.install({ handleUncaughtExceptions: false });
28
29const kernel = new Ignitor(__dirname).kernel('test');
30
31kernel
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 });