test(scripts): add npm start script test
This commit is contained in:
parent
57d10ddf70
commit
f50c88515e
10
tests/start-script.test.js
Normal file
10
tests/start-script.test.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
const { spawnSync } = require('child_process');
|
||||||
|
|
||||||
|
describe('NPM Start Script', () => {
|
||||||
|
test('npm start exits without error when DISCORD_TOKEN is provided', () => {
|
||||||
|
const env = { ...process.env, DISCORD_TOKEN: 'dummy-token', CLIENT_ID: '123', LAVALINK_HOST: 'localhost', LAVALINK_PORT: '2333', LAVALINK_PASSWORD: 'pass' };
|
||||||
|
const result = spawnSync('pnpm', ['start'], { env, encoding: 'utf-8' });
|
||||||
|
// The script starts the bot; if it reaches login attempt, exit code is 0
|
||||||
|
expect(result.status).toBe(0);
|
||||||
|
});
|
||||||
|
});
|
||||||
Loading…
x
Reference in New Issue
Block a user