test: fix odd behavior

This commit is contained in:
Elliot DeNolf
2022-07-18 15:27:20 -07:00
parent 9021d5352d
commit 2a7651eb9c
3 changed files with 10 additions and 8 deletions

View File

@@ -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",

View File

@@ -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: {

View File

@@ -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();