refactor: Convert project from JavaScript to TypeScript
- Converted all .js files to .ts - Added TypeScript configuration (tsconfig.json) - Added ESLint and Prettier configuration - Updated package.json dependencies - Modified Docker and application configurations
This commit is contained in:
13
tests/startup.test.ts
Normal file
13
tests/startup.test.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
const { spawnSync } = require('child_process');
|
||||
|
||||
describe('Bot Startup', () => {
|
||||
test('exits with code 1 if DISCORD_TOKEN is missing', () => {
|
||||
// Clear DISCORD_TOKEN
|
||||
const env = { ...process.env };
|
||||
delete env.DISCORD_TOKEN;
|
||||
|
||||
const result = spawnSync('node', ['src/index.js'], { env, encoding: 'utf-8' });
|
||||
expect(result.status).toBe(1);
|
||||
expect(result.stderr || result.stdout).toMatch(/DISCORD_TOKEN is missing/);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user