chore: add error message if test config doesn't exist
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const babelConfig = require('../babel.config');
|
const babelConfig = require('../babel.config');
|
||||||
|
|
||||||
@@ -15,6 +16,12 @@ require('@babel/register')({
|
|||||||
const [testSuiteDir] = process.argv.slice(2);
|
const [testSuiteDir] = process.argv.slice(2);
|
||||||
|
|
||||||
const configPath = path.resolve(__dirname, testSuiteDir, 'config.ts');
|
const configPath = path.resolve(__dirname, testSuiteDir, 'config.ts');
|
||||||
|
|
||||||
|
if (!fs.existsSync(configPath)) {
|
||||||
|
console.error('ERROR: You must pass a valid directory under test/ that contains a config.ts');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
process.env.PAYLOAD_CONFIG_PATH = configPath;
|
process.env.PAYLOAD_CONFIG_PATH = configPath;
|
||||||
process.env.PAYLOAD_DROP_DATABASE = 'true';
|
process.env.PAYLOAD_DROP_DATABASE = 'true';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user