Skip to content

What is the best way to test with trpc-shield? #20

Closed Answered by okeeffed
okeeffed asked this question in Q&A
Discussion options

You must be logged in to vote

Ahhh I actually figured this out! Needed the rejects for the promise. For example:

it("does not allow USER role", () => {
    const t = async () => {
      await trpcRequest().post.findManyPost({});
    };
    expect(t).rejects.toThrow();
});

Woo!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by okeeffed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant