attempt to fix test
This commit is contained in:
parent
0770ee82eb
commit
c306cdbdd9
|
|
@ -136,7 +136,7 @@ module.exports = {
|
||||||
// runner: "jest-runner",
|
// runner: "jest-runner",
|
||||||
|
|
||||||
// The paths to modules that run some code to configure or set up the testing environment before each test
|
// The paths to modules that run some code to configure or set up the testing environment before each test
|
||||||
// setupFiles: [],
|
setupFiles: ["<rootDir>/test/jest.setup.ts"],
|
||||||
|
|
||||||
// A list of paths to modules that run some code to configure or set up the testing framework before each test
|
// A list of paths to modules that run some code to configure or set up the testing framework before each test
|
||||||
// setupFilesAfterEnv: [],
|
// setupFilesAfterEnv: [],
|
||||||
|
|
@ -151,9 +151,7 @@ module.exports = {
|
||||||
testEnvironment: "node",
|
testEnvironment: "node",
|
||||||
|
|
||||||
// Options that will be passed to the testEnvironment
|
// Options that will be passed to the testEnvironment
|
||||||
testEnvironmentOptions: {
|
// testEnvironmentOptions: {},
|
||||||
globalsCleanup: 'soft', // Soft cleanup mode to avoid issues with global variables in tests
|
|
||||||
},
|
|
||||||
|
|
||||||
// Adds a location field to test results
|
// Adds a location field to test results
|
||||||
// testLocationInResults: false,
|
// testLocationInResults: false,
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ const base = require('./jest.config.cjs')
|
||||||
module.exports = {
|
module.exports = {
|
||||||
...base,
|
...base,
|
||||||
globalSetup: "<rootDir>/built-test/entry.js",
|
globalSetup: "<rootDir>/built-test/entry.js",
|
||||||
setupFilesAfterEnv: ["<rootDir>/test/jest.setup.ts"],
|
setupFilesAfterEnv: ["<rootDir>/test/jest.setup.e2e.ts"],
|
||||||
testMatch: [
|
testMatch: [
|
||||||
"<rootDir>/test/e2e/**/*.ts",
|
"<rootDir>/test/e2e/**/*.ts",
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -236,6 +236,7 @@
|
||||||
"fkill": "9.0.0",
|
"fkill": "9.0.0",
|
||||||
"jest": "30.0.0",
|
"jest": "30.0.0",
|
||||||
"jest-mock": "30.0.0",
|
"jest-mock": "30.0.0",
|
||||||
|
"jest-util": "30.0.0",
|
||||||
"nodemon": "3.1.10",
|
"nodemon": "3.1.10",
|
||||||
"pid-port": "1.0.2",
|
"pid-port": "1.0.2",
|
||||||
"simple-oauth2": "5.1.0",
|
"simple-oauth2": "5.1.0",
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { initTestDb, sendEnvResetRequest } from './utils.js';
|
||||||
|
|
||||||
|
beforeAll(async () => {
|
||||||
|
await initTestDb(false);
|
||||||
|
await sendEnvResetRequest();
|
||||||
|
});
|
||||||
|
|
@ -3,9 +3,8 @@
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { initTestDb, sendEnvResetRequest } from './utils.js';
|
import { protectProperties } from 'jest-util';
|
||||||
|
|
||||||
beforeAll(async () => {
|
protectProperties(globalThis.ReadableStreamDefaultReader);
|
||||||
await initTestDb(false);
|
protectProperties(globalThis.ReadableStreamBYOBReader);
|
||||||
await sendEnvResetRequest();
|
protectProperties(globalThis.WritableStreamDefaultWriter);
|
||||||
});
|
|
||||||
|
|
|
||||||
|
|
@ -589,6 +589,9 @@ importers:
|
||||||
jest-mock:
|
jest-mock:
|
||||||
specifier: 30.0.0
|
specifier: 30.0.0
|
||||||
version: 30.0.0
|
version: 30.0.0
|
||||||
|
jest-util:
|
||||||
|
specifier: 30.0.0
|
||||||
|
version: 30.0.0
|
||||||
nodemon:
|
nodemon:
|
||||||
specifier: 3.1.10
|
specifier: 3.1.10
|
||||||
version: 3.1.10
|
version: 3.1.10
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue