Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(jobs tests): String literal array for queues #11370

Merged
merged 1 commit into from
Aug 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading