- npm added @japa/api-client, @japa/assert, @types/supertest
Some checks failed
CI Pipeline / japa-tests (push) Failing after 1m13s

- webpack added opions['__VUE_PROD_HYDRATION_MISMATCH_DETAILS__'] = false;
- bodyparser config replaced whitelistedMethods with allowedMethods
- extended stardust_provider
- adapted tests for adonisjs v6
This commit is contained in:
Kaimbacher 2024-04-25 15:17:22 +02:00
parent 296c8fd46e
commit bee76f8d5b
23 changed files with 2014 additions and 165 deletions

View file

@ -5,9 +5,16 @@
* file.
*/
import type { Config } from '@japa/runner';
import TestUtils from '@ioc:Adonis/Core/TestUtils';
import { assert, runFailedTests, specReporter, apiClient } from '@japa/preset-adonis';
// import type { Config } from '@japa/runner';
import type { Config } from '@japa/runner/types';
// import TestUtils from '@ioc:Adonis/Core/TestUtils';
import testUtils from '@adonisjs/core/services/test_utils';
// import { assert, runFailedTests, specReporter, apiClient } from '@japa/preset-adonis';
import { assert } from '@japa/assert';
import { apiClient } from '@japa/api-client';
import { pluginAdonisJS } from '@japa/plugin-adonisjs';
import app from '@adonisjs/core/services/app';
/*
|--------------------------------------------------------------------------
@ -20,7 +27,8 @@ import { assert, runFailedTests, specReporter, apiClient } from '@japa/preset-ad
| Feel free to remove existing plugins or add more.
|
*/
export const plugins: Required<Config>['plugins'] = [assert(), runFailedTests(), apiClient()];
// export const plugins: Required<Config>['plugins'] = [assert(), runFailedTests(), apiClient()];
export const plugins: Config['plugins'] = [assert(), apiClient(), pluginAdonisJS(app)];
/*
|--------------------------------------------------------------------------
@ -32,7 +40,10 @@ export const plugins: Required<Config>['plugins'] = [assert(), runFailedTests(),
| of tests on the terminal.
|
*/
export const reporters: Required<Config>['reporters'] = [specReporter()];
// export const reporters: Required<Config>['reporters'] = [specReporter()];
export const reporters: Required<Config>['reporters'] = {
activated: ['spec'],
};
/*
|--------------------------------------------------------------------------
@ -48,8 +59,9 @@ export const reporters: Required<Config>['reporters'] = [specReporter()];
*/
export const runnerHooks: Pick<Required<Config>, 'setup' | 'teardown'> = {
setup: [
() => TestUtils.ace().loadCommands(),
() => TestUtils.db().migrate()
// () => testUtils.ace().loadCommands(),
() => testUtils.db().migrate(),
// () => testUtils.httpServer().start(),
],
teardown: [],
};
@ -67,6 +79,6 @@ export const runnerHooks: Pick<Required<Config>, 'setup' | 'teardown'> = {
*/
export const configureSuite: Required<Config>['configureSuite'] = (suite) => {
if (suite.name === 'functional') {
suite.setup(() => TestUtils.httpServer().start());
suite.setup(() => testUtils.httpServer().start());
}
};