chore: add mandatory test concept and smoke-test workflow
This commit is contained in:
parent
d08e6f8a17
commit
d2ed667f0c
3 changed files with 59 additions and 2 deletions
20
backend/scripts/smoke-test.mjs
Normal file
20
backend/scripts/smoke-test.mjs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { spawn } from 'node:child_process';
|
||||
|
||||
const run = (cmd, args, opts = {}) =>
|
||||
new Promise((resolve, reject) => {
|
||||
const p = spawn(cmd, args, { stdio: 'inherit', ...opts });
|
||||
p.on('exit', (code) => (code === 0 ? resolve() : reject(new Error(`${cmd} exited with ${code}`))));
|
||||
});
|
||||
|
||||
const main = async () => {
|
||||
await run('bash', ['-lc', 'find src -name "*.js" -print0 | xargs -0 -n1 node --check'], {
|
||||
cwd: process.cwd(),
|
||||
});
|
||||
|
||||
console.log('Smoke test passed: syntax checks OK');
|
||||
};
|
||||
|
||||
main().catch((err) => {
|
||||
console.error('Smoke test failed:', err.message);
|
||||
process.exit(1);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue