Skip to content
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
12 changes: 11 additions & 1 deletion __tests__/bundle/cronJobsInput.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { runBundle } from './runBundle'
vi.setConfig({ testTimeout: 30_000 })

// the `jobs` input validation of the cron dispatcher, driven through dist/index.js: the push event routes to the
// cron jobs like schedule and workflow_dispatch do, and a blank list fails the run before anything talks to the api
// cron jobs like schedule and workflow_dispatch do, a blank list fails the run before anything talks to the api,
// and a name the dispatcher does not know fails the run
describe('dist/index.js cron jobs input', () => {
let gh: FakeGithub

Expand All @@ -33,4 +34,13 @@ describe('dist/index.js cron jobs input', () => {
expect(result.errors.some(e => /please provide a list of space delimited/.test(e))).toBe(true)
expect(gh.requests).toEqual([])
})

it('an unknown job name fails the run lowercased, naming the docs, and calls no api', async () => {
const result = await runBundle({ eventName: 'workflow_dispatch', payload: {}, inputs: { ...token, jobs: 'Tide' }, apiUrl: gh.url })

expect(result.status, result.stdout).toBe(1)
expect(result.errors).toHaveLength(1)
expect(result.errors[0]).toContain('could not execute tide')
expect(gh.requests).toEqual([])
})
})
Loading