Skip to content

Commit

Permalink
[test] Fix unhandled promise and the assertion.
Browse files Browse the repository at this point in the history
* Need to await
* Had to use this way to assert, as suggested here:
  jestjs/jest#3601 (comment)
  • Loading branch information
alloy committed Feb 16, 2018
1 parent a5e6c01 commit e0239f3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/schema/__tests__/sale_artwork.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,11 @@ describe("SaleArtwork type", () => {
incrementsLoader: () => Promise.resolve(),
}

expect(execute(query, gravityResponse, rootValue)).rejects.toContain(
"Missing increment strategy"
await expect(
execute(query, gravityResponse, rootValue)
).rejects.toHaveProperty(
"message",
"schema/sale_artwork - Missing increment strategy"
)
})

Expand Down

0 comments on commit e0239f3

Please sign in to comment.