Skip to content

Commit

Permalink
chore(jobs tests): String literal array for queues (#11370)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe authored Aug 24, 2024
1 parent c6c6bfc commit 8303337
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/jobs/src/core/__tests__/JobManager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ vi.mock('../Scheduler')
describe('constructor', () => {
const mockAdapter = new MockAdapter()
const adapters = { mock: mockAdapter }
const queues = ['queue']
const queues = ['queue'] as const
const logger = mockLogger
const workers = [
{
adapter: 'mock' as const,
queue: '*',
queue: '*' as const,
count: 1,
},
]
Expand Down Expand Up @@ -61,7 +61,7 @@ describe('createScheduler()', () => {
adapters: {
mock: mockAdapter,
},
queues: [],
queues: ['default'] as const,
logger: mockLogger,
workers: [],
})
Expand All @@ -76,7 +76,7 @@ describe('createScheduler()', () => {
adapters: {
mock: mockAdapter,
},
queues: ['*'],
queues: ['*'] as const,
logger: mockLogger,
workers: [],
})
Expand All @@ -92,7 +92,7 @@ describe('createScheduler()', () => {
adapters: {
mock: mockAdapter,
},
queues: [],
queues: ['default'] as const,
logger: mockLogger,
workers: [],
})
Expand All @@ -108,11 +108,11 @@ describe('createScheduler()', () => {
adapters: {
mock: mockAdapter,
},
queues: ['default'],
queues: ['default'] as const,
logger: mockLogger,
workers: [],
})
const mockJob: Job<string[], unknown[]> = {
const mockJob: Job<['default'], unknown[]> = {
queue: 'default',
name: 'mockJob',
path: 'mockJob/mockJob',
Expand All @@ -137,11 +137,11 @@ describe('createJob()', () => {
it('returns the same job description that was passed in', () => {
const manager = new JobManager({
adapters: {},
queues: ['default'],
queues: ['default'] as const,
logger: mockLogger,
workers: [],
})
const jobDefinition: JobDefinition<string[], unknown[]> = {
const jobDefinition: JobDefinition<['default'], unknown[]> = {
queue: 'default',
perform: vi.fn(),
}
Expand Down

0 comments on commit 8303337

Please sign in to comment.