tests
This commit is contained in:
parent
3a7254708e
commit
b63e58784c
41 changed files with 5762 additions and 4477 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { describe, expect, it, beforeEach, afterEach } from 'bun:test';
|
||||
import { getRedisConnection } from '../src/utils';
|
||||
import { afterEach, beforeEach, describe, expect, it } from 'bun:test';
|
||||
import type { RedisConfig } from '../src/types';
|
||||
import { getRedisConnection } from '../src/utils';
|
||||
|
||||
describe('Queue Utils', () => {
|
||||
describe('getRedisConnection', () => {
|
||||
|
|
@ -16,7 +16,7 @@ describe('Queue Utils', () => {
|
|||
|
||||
it('should return test connection in test environment', () => {
|
||||
process.env.NODE_ENV = 'test';
|
||||
|
||||
|
||||
const config: RedisConfig = {
|
||||
host: 'production.redis.com',
|
||||
port: 6380,
|
||||
|
|
@ -32,7 +32,7 @@ describe('Queue Utils', () => {
|
|||
|
||||
it('should return test connection when BUNIT is set', () => {
|
||||
process.env.BUNIT = '1';
|
||||
|
||||
|
||||
const config: RedisConfig = {
|
||||
host: 'production.redis.com',
|
||||
port: 6380,
|
||||
|
|
@ -47,7 +47,7 @@ describe('Queue Utils', () => {
|
|||
it('should return actual config in non-test environment', () => {
|
||||
process.env.NODE_ENV = 'production';
|
||||
delete process.env.BUNIT;
|
||||
|
||||
|
||||
const config: RedisConfig = {
|
||||
host: 'production.redis.com',
|
||||
port: 6380,
|
||||
|
|
@ -72,7 +72,7 @@ describe('Queue Utils', () => {
|
|||
|
||||
it('should handle minimal config', () => {
|
||||
process.env.NODE_ENV = 'development';
|
||||
|
||||
|
||||
const config: RedisConfig = {
|
||||
host: 'localhost',
|
||||
port: 6379,
|
||||
|
|
@ -89,7 +89,7 @@ describe('Queue Utils', () => {
|
|||
it('should preserve all config properties in non-test mode', () => {
|
||||
delete process.env.NODE_ENV;
|
||||
delete process.env.BUNIT;
|
||||
|
||||
|
||||
const config: RedisConfig = {
|
||||
host: 'redis.example.com',
|
||||
port: 6379,
|
||||
|
|
@ -115,4 +115,4 @@ describe('Queue Utils', () => {
|
|||
expect(connection.username).toBe('admin'); // Preserved from original
|
||||
});
|
||||
});
|
||||
})
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue