fixed format issues
This commit is contained in:
parent
a700818a06
commit
08f713d98b
55 changed files with 5680 additions and 5533 deletions
|
|
@ -1,71 +1,76 @@
|
|||
import { describe, it, expect } from 'bun:test';
|
||||
import type { ServiceDefinitions, ServiceContainer, ServiceCradle, ServiceContainerOptions } from '../src/awilix-container';
|
||||
|
||||
describe('Awilix Container Types', () => {
|
||||
it('should export ServiceDefinitions interface', () => {
|
||||
// Type test - if this compiles, the type exists
|
||||
const testDefinitions: Partial<ServiceDefinitions> = {
|
||||
config: {} as any,
|
||||
logger: {} as any,
|
||||
cache: null,
|
||||
proxyManager: null,
|
||||
browser: {} as any,
|
||||
queueManager: null,
|
||||
mongoClient: null,
|
||||
postgresClient: null,
|
||||
questdbClient: null,
|
||||
serviceContainer: {} as any,
|
||||
};
|
||||
|
||||
expect(testDefinitions).toBeDefined();
|
||||
});
|
||||
|
||||
it('should export ServiceContainer type', () => {
|
||||
// Type test - if this compiles, the type exists
|
||||
const testContainer: ServiceContainer | null = null;
|
||||
expect(testContainer).toBeNull();
|
||||
});
|
||||
|
||||
it('should export ServiceCradle type', () => {
|
||||
// Type test - if this compiles, the type exists
|
||||
const testCradle: Partial<ServiceCradle> = {
|
||||
config: {} as any,
|
||||
logger: {} as any,
|
||||
};
|
||||
|
||||
expect(testCradle).toBeDefined();
|
||||
});
|
||||
|
||||
it('should export ServiceContainerOptions interface', () => {
|
||||
// Type test - if this compiles, the type exists
|
||||
const testOptions: ServiceContainerOptions = {
|
||||
enableQuestDB: true,
|
||||
enableMongoDB: true,
|
||||
enablePostgres: true,
|
||||
enableCache: true,
|
||||
enableQueue: true,
|
||||
enableBrowser: true,
|
||||
enableProxy: true,
|
||||
};
|
||||
|
||||
expect(testOptions).toBeDefined();
|
||||
expect(testOptions.enableQuestDB).toBe(true);
|
||||
expect(testOptions.enableMongoDB).toBe(true);
|
||||
expect(testOptions.enablePostgres).toBe(true);
|
||||
expect(testOptions.enableCache).toBe(true);
|
||||
expect(testOptions.enableQueue).toBe(true);
|
||||
expect(testOptions.enableBrowser).toBe(true);
|
||||
expect(testOptions.enableProxy).toBe(true);
|
||||
});
|
||||
|
||||
it('should allow partial ServiceContainerOptions', () => {
|
||||
const partialOptions: ServiceContainerOptions = {
|
||||
enableCache: true,
|
||||
enableQueue: false,
|
||||
};
|
||||
|
||||
expect(partialOptions.enableCache).toBe(true);
|
||||
expect(partialOptions.enableQueue).toBe(false);
|
||||
expect(partialOptions.enableQuestDB).toBeUndefined();
|
||||
});
|
||||
});
|
||||
import { describe, expect, it } from 'bun:test';
|
||||
import type {
|
||||
ServiceContainer,
|
||||
ServiceContainerOptions,
|
||||
ServiceCradle,
|
||||
ServiceDefinitions,
|
||||
} from '../src/awilix-container';
|
||||
|
||||
describe('Awilix Container Types', () => {
|
||||
it('should export ServiceDefinitions interface', () => {
|
||||
// Type test - if this compiles, the type exists
|
||||
const testDefinitions: Partial<ServiceDefinitions> = {
|
||||
config: {} as any,
|
||||
logger: {} as any,
|
||||
cache: null,
|
||||
proxyManager: null,
|
||||
browser: {} as any,
|
||||
queueManager: null,
|
||||
mongoClient: null,
|
||||
postgresClient: null,
|
||||
questdbClient: null,
|
||||
serviceContainer: {} as any,
|
||||
};
|
||||
|
||||
expect(testDefinitions).toBeDefined();
|
||||
});
|
||||
|
||||
it('should export ServiceContainer type', () => {
|
||||
// Type test - if this compiles, the type exists
|
||||
const testContainer: ServiceContainer | null = null;
|
||||
expect(testContainer).toBeNull();
|
||||
});
|
||||
|
||||
it('should export ServiceCradle type', () => {
|
||||
// Type test - if this compiles, the type exists
|
||||
const testCradle: Partial<ServiceCradle> = {
|
||||
config: {} as any,
|
||||
logger: {} as any,
|
||||
};
|
||||
|
||||
expect(testCradle).toBeDefined();
|
||||
});
|
||||
|
||||
it('should export ServiceContainerOptions interface', () => {
|
||||
// Type test - if this compiles, the type exists
|
||||
const testOptions: ServiceContainerOptions = {
|
||||
enableQuestDB: true,
|
||||
enableMongoDB: true,
|
||||
enablePostgres: true,
|
||||
enableCache: true,
|
||||
enableQueue: true,
|
||||
enableBrowser: true,
|
||||
enableProxy: true,
|
||||
};
|
||||
|
||||
expect(testOptions).toBeDefined();
|
||||
expect(testOptions.enableQuestDB).toBe(true);
|
||||
expect(testOptions.enableMongoDB).toBe(true);
|
||||
expect(testOptions.enablePostgres).toBe(true);
|
||||
expect(testOptions.enableCache).toBe(true);
|
||||
expect(testOptions.enableQueue).toBe(true);
|
||||
expect(testOptions.enableBrowser).toBe(true);
|
||||
expect(testOptions.enableProxy).toBe(true);
|
||||
});
|
||||
|
||||
it('should allow partial ServiceContainerOptions', () => {
|
||||
const partialOptions: ServiceContainerOptions = {
|
||||
enableCache: true,
|
||||
enableQueue: false,
|
||||
};
|
||||
|
||||
expect(partialOptions.enableCache).toBe(true);
|
||||
expect(partialOptions.enableQueue).toBe(false);
|
||||
expect(partialOptions.enableQuestDB).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue