* feat: implements esbuild and removes babel * chore: implements esbuild-register * chore: tests passing * chore: implements @swc/jest for tests * feat: implements swc * chore: removes build and relies on swc/register only * chore: converts some exports * chore: flattens ts configs * chore: allows tsx in swc * chore: converts more exports into js * chore: restores payload module.exports * chore: removes unused dependency
28 lines
659 B
JavaScript
28 lines
659 B
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
const { register } = require('esbuild-register/dist/node');
|
|
|
|
const [testSuiteDir] = process.argv.slice(2);
|
|
|
|
if (!testSuiteDir) {
|
|
console.error('ERROR: You must provide an argument for "testSuiteDir"');
|
|
process.exit(1);
|
|
}
|
|
|
|
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_DROP_DATABASE = 'true';
|
|
|
|
register({
|
|
platform: 'node',
|
|
});
|
|
|
|
require('./devServer');
|