style: format and lint codebase using Biome v2
This commit is contained in:
+22
-22
@@ -1,46 +1,46 @@
|
||||
// @ts-nocheck
|
||||
import { describe, it, expect, beforeAll } from "bun:test";
|
||||
import { config } from "../src/env";
|
||||
import { describe, expect, it } from 'bun:test';
|
||||
import { config } from '../src/env';
|
||||
|
||||
describe("Environment Variables Validation", () => {
|
||||
it("config should have all required fields", () => {
|
||||
expect(config).toHaveProperty("botToken");
|
||||
expect(config).toHaveProperty("storageChatId");
|
||||
expect(config).toHaveProperty("baseUrl");
|
||||
expect(config).toHaveProperty("databaseUrl");
|
||||
expect(config).toHaveProperty("port");
|
||||
expect(config).toHaveProperty("nodeEnv");
|
||||
expect(config).toHaveProperty("logLevel");
|
||||
expect(config).toHaveProperty("rateLimitWindowMs");
|
||||
expect(config).toHaveProperty("rateLimitMaxRequests");
|
||||
describe('Environment Variables Validation', () => {
|
||||
it('config should have all required fields', () => {
|
||||
expect(config).toHaveProperty('botToken');
|
||||
expect(config).toHaveProperty('storageChatId');
|
||||
expect(config).toHaveProperty('baseUrl');
|
||||
expect(config).toHaveProperty('databaseUrl');
|
||||
expect(config).toHaveProperty('port');
|
||||
expect(config).toHaveProperty('nodeEnv');
|
||||
expect(config).toHaveProperty('logLevel');
|
||||
expect(config).toHaveProperty('rateLimitWindowMs');
|
||||
expect(config).toHaveProperty('rateLimitMaxRequests');
|
||||
});
|
||||
|
||||
it("config.botToken should return BOT_TOKEN from process.env", () => {
|
||||
it('config.botToken should return BOT_TOKEN from process.env', () => {
|
||||
expect(config.botToken).toBe(process.env.BOT_TOKEN);
|
||||
});
|
||||
|
||||
it("config.storageChatId should be parsed as integer from STORAGE_CHANNEL_ID", () => {
|
||||
expect(typeof config.storageChatId).toBe("number");
|
||||
it('config.storageChatId should be parsed as integer from STORAGE_CHANNEL_ID', () => {
|
||||
expect(typeof config.storageChatId).toBe('number');
|
||||
expect(config.storageChatId).toBe(parseInt(process.env.STORAGE_CHANNEL_ID, 10));
|
||||
});
|
||||
|
||||
it("config.port should default to 3000 when not specified", () => {
|
||||
expect(typeof config.port).toBe("number");
|
||||
it('config.port should default to 3000 when not specified', () => {
|
||||
expect(typeof config.port).toBe('number');
|
||||
});
|
||||
|
||||
it("nodeEnv should be 'test' or 'development'", () => {
|
||||
expect(["test", "development"]).toContain(config.nodeEnv);
|
||||
expect(['test', 'development']).toContain(config.nodeEnv);
|
||||
});
|
||||
|
||||
it("logLevel should default to 'info'", () => {
|
||||
expect(config.logLevel).toBe("info");
|
||||
expect(config.logLevel).toBe('info');
|
||||
});
|
||||
|
||||
it("rateLimitWindowMs should default to 60000 when not specified", () => {
|
||||
it('rateLimitWindowMs should default to 60000 when not specified', () => {
|
||||
expect(config.rateLimitWindowMs).toBe(60000);
|
||||
});
|
||||
|
||||
it("rateLimitMaxRequests should default to 30 when not specified", () => {
|
||||
it('rateLimitMaxRequests should default to 30 when not specified', () => {
|
||||
expect(config.rateLimitMaxRequests).toBe(30);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user