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(gatsby): convert jobs to typescript #24209

Merged
merged 5 commits into from
May 19, 2020
Merged
Changes from 1 commit
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
Prev Previous commit
Revert function -> const change
  • Loading branch information
Kornil committed May 19, 2020
commit 57a1e0df50c32dfa970dfda8803ff7691d2d3c31
5 changes: 3 additions & 2 deletions packages/gatsby/src/redux/__tests__/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,16 @@ describe(`Job actions/reducer`, () => {
})

it(`throws an error if an ID isn't provided`, done => {
const runReducer = (): IGatsbyState["jobs"] =>
function runReducer(): void {
jobsReducer(undefined, actions.createJob(`test job`))
}

expect(runReducer).toThrowErrorMatchingSnapshot()
done()
})

it(`throws an error if endJob is called for a job that's already ended`, done => {
const runReducer = (): IGatsbyState["jobs"] => {
function runReducer(): IGatsbyState["jobs"] {
let state = jobsReducer(undefined, actions.createJob({ id: `test job` }))
state = jobsReducer(state, actions.endJob({ id: `test job` }))
state = jobsReducer(
Expand Down