Skip to content
Permalink
Browse files

Add a unit test for the createInstance displayName arg. (#108)

  • Loading branch information...
artdent authored and ghengeveld committed Sep 9, 2019
1 parent 352875a commit 1ea71b606a0f19aeab8e70e45a44ce110f05846c
Showing with 11 additions and 0 deletions.
  1. +11 −0 packages/react-async/src/Async.spec.js
@@ -302,4 +302,15 @@ describe("createInstance", () => {
abortCtrl
)
})

test("allows setting displayName", () => {
const promiseFn = () => resolveTo("done")
const CustomAsync = createInstance({ promiseFn }, "CustomAsync")
expect(CustomAsync.displayName).toBe("CustomAsync")
expect(CustomAsync.Initial.displayName).toBe("CustomAsync.Initial")
expect(CustomAsync.Pending.displayName).toBe("CustomAsync.Pending")
expect(CustomAsync.Fulfilled.displayName).toBe("CustomAsync.Fulfilled")
expect(CustomAsync.Rejected.displayName).toBe("CustomAsync.Rejected")
expect(CustomAsync.Settled.displayName).toBe("CustomAsync.Settled")
})
})

0 comments on commit 1ea71b6

Please sign in to comment.
You can’t perform that action at this time.