Reorganize app workspaces and align Admin architecture
This commit is contained in:
Executable
+45
@@ -0,0 +1,45 @@
|
||||
// apps/backend/tests/bootstrap.ts
|
||||
import { assert } from '@japa/assert'
|
||||
import { apiClient } from '@japa/api-client'
|
||||
import { pluginAdonisJS } from '@japa/plugin-adonisjs'
|
||||
import { specReporter } from '@japa/spec-reporter'
|
||||
import type { Config } from '@japa/runner/types'
|
||||
|
||||
import app from '@adonisjs/core/services/app'
|
||||
import testUtils from '@adonisjs/core/services/test_utils'
|
||||
|
||||
/**
|
||||
* Japa plugins
|
||||
*/
|
||||
export const plugins: Config['plugins'] = [assert(), apiClient(), pluginAdonisJS(app)]
|
||||
|
||||
/**
|
||||
* Reporters
|
||||
*/
|
||||
export const reporters: Config['reporters'] = {
|
||||
activated: ['spec'],
|
||||
list: [
|
||||
{
|
||||
name: 'spec',
|
||||
handler: specReporter(),
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
/**
|
||||
* Global setup/teardown (for ALL suites)
|
||||
*/
|
||||
export const runnerHooks: Required<Pick<Config, 'setup' | 'teardown'>> = {
|
||||
setup: [],
|
||||
teardown: [],
|
||||
}
|
||||
|
||||
/**
|
||||
* Per-suite configuration (start HTTP server for HTTP tests)
|
||||
*/
|
||||
export const configureSuite: Config['configureSuite'] = (suite) => {
|
||||
// adjust names to your suites if needed
|
||||
if (['functional', 'e2e', 'browser'].includes(suite.name)) {
|
||||
suite.setup(() => testUtils.httpServer().start())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user