test: fix odd behavior
This commit is contained in:
10
package.json
10
package.json
@@ -36,11 +36,11 @@
|
||||
"dev:generate-types": "node ./test/generateTypes.js",
|
||||
"pretest": "yarn build",
|
||||
"test": "yarn test:int && yarn test:components",
|
||||
"test:int": "cross-env NODE_ENV=test DISABLE_LOGGING=true jest --forceExit --detectOpenHandles",
|
||||
"test:e2e": "cross-env NODE_ENV=test DISABLE_LOGGING=true playwright test",
|
||||
"test:e2e:headed": "cross-env NODE_ENV=test DISABLE_LOGGING=true playwright test --headed",
|
||||
"test:e2e:debug": "cross-env PWDEBUG=1 NODE_ENV=test DISABLE_LOGGING=true playwright test",
|
||||
"test:components": "cross-env NODE_ENV=test jest --config=jest.components.config.js",
|
||||
"test:int": "cross-env DISABLE_LOGGING=true jest --forceExit --detectOpenHandles",
|
||||
"test:e2e": "cross-env DISABLE_LOGGING=true playwright test",
|
||||
"test:e2e:headed": "cross-env DISABLE_LOGGING=true playwright test --headed",
|
||||
"test:e2e:debug": "cross-env PWDEBUG=1 DISABLE_LOGGING=true playwright test",
|
||||
"test:components": "cross-env jest --config=jest.components.config.js",
|
||||
"clean": "rimraf dist",
|
||||
"release": "release-it",
|
||||
"release:patch": "release-it patch",
|
||||
|
||||
@@ -6,6 +6,7 @@ const baseConfig: Config = {
|
||||
typescript: {
|
||||
outputFile: process.env.PAYLOAD_TS_OUTPUT_PATH,
|
||||
},
|
||||
telemetry: false,
|
||||
};
|
||||
|
||||
export function buildConfig(overrides?: Partial<Config>): SanitizedConfig {
|
||||
@@ -13,8 +14,9 @@ export function buildConfig(overrides?: Partial<Config>): SanitizedConfig {
|
||||
baseConfig.admin = {
|
||||
...(baseConfig.admin || {}),
|
||||
webpack: (config) => {
|
||||
const existingConfig =
|
||||
typeof overrides?.admin?.webpack === 'function' ? overrides.admin.webpack(config) : config;
|
||||
const existingConfig = typeof overrides?.admin?.webpack === 'function'
|
||||
? overrides.admin.webpack(config)
|
||||
: config;
|
||||
return {
|
||||
...existingConfig,
|
||||
cache: {
|
||||
|
||||
@@ -28,7 +28,7 @@ export async function initPayloadTest(options: Options): Promise<{ serverURL: st
|
||||
...(options.init || {}),
|
||||
};
|
||||
|
||||
process.env.PAYLOAD_DISABLE_ADMIN = 'true';
|
||||
process.env.NODE_ENV = 'test';
|
||||
process.env.PAYLOAD_CONFIG_PATH = path.resolve(options.__dirname, './config.ts');
|
||||
|
||||
const port = await getPort();
|
||||
|
||||
Reference in New Issue
Block a user