Skip to content

Commit 4415f9d

Browse files
committed
chore: add error message if test config doesn't exist
1 parent f6ff308 commit 4415f9d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/dev.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const fs = require('fs');
12
const path = require('path');
23
const babelConfig = require('../babel.config');
34

@@ -15,6 +16,12 @@ require('@babel/register')({
1516
const [testSuiteDir] = process.argv.slice(2);
1617

1718
const configPath = path.resolve(__dirname, testSuiteDir, 'config.ts');
19+
20+
if (!fs.existsSync(configPath)) {
21+
console.error('ERROR: You must pass a valid directory under test/ that contains a config.ts');
22+
process.exit(1);
23+
}
24+
1825
process.env.PAYLOAD_CONFIG_PATH = configPath;
1926
process.env.PAYLOAD_DROP_DATABASE = 'true';
2027

0 commit comments

Comments
 (0)