Mercurial
comparison benchmark/bun-http-framework-benchmark/dev/adonis/test.ts @ 185:dfdd66825396
Merged in keep alive changes and mrjunejune changes.
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Fri, 23 Jan 2026 22:22:30 -0800 |
| parents | a8976a008a9d |
| children |
comparison
equal
deleted
inserted
replaced
| 182:d6ab5921fedc | 185:dfdd66825396 |
|---|---|
| 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 process.env.NODE_ENV = 'test' | |
| 16 | |
| 17 import 'reflect-metadata' | |
| 18 import sourceMapSupport from 'source-map-support' | |
| 19 import { Ignitor } from '@adonisjs/core/build/standalone' | |
| 20 import { configure, processCliArgs, run, RunnerHooksHandler } from '@japa/runner' | |
| 21 | |
| 22 sourceMapSupport.install({ handleUncaughtExceptions: false }) | |
| 23 | |
| 24 const kernel = new Ignitor(__dirname).kernel('test') | |
| 25 | |
| 26 kernel | |
| 27 .boot() | |
| 28 .then(() => import('./tests/bootstrap')) | |
| 29 .then(({ runnerHooks, ...config }) => { | |
| 30 const app: RunnerHooksHandler[] = [() => kernel.start()] | |
| 31 | |
| 32 configure({ | |
| 33 ...kernel.application.rcFile.tests, | |
| 34 ...processCliArgs(process.argv.slice(2)), | |
| 35 ...config, | |
| 36 ...{ | |
| 37 importer: (filePath) => import(filePath), | |
| 38 setup: app.concat(runnerHooks.setup), | |
| 39 teardown: runnerHooks.teardown, | |
| 40 }, | |
| 41 cwd: kernel.application.appRoot, | |
| 42 }) | |
| 43 | |
| 44 run() | |
| 45 }) |