From a77fee6f7275a1237fe6ca77a58bb31191f4f2c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20G=C3=A9rault?= Date: Sat, 20 Jan 2024 22:32:05 +0100 Subject: [PATCH] doc(plugins): add help for type error about expect plugin When installing japa from the doc instructions, it is not mentioned to include the bin folder, which can lead to a TypeScript error saying expect is not available in TestContext type --- content/docs/plugins/expect.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/content/docs/plugins/expect.md b/content/docs/plugins/expect.md index 2c4a0e6..9c0c248 100644 --- a/content/docs/plugins/expect.md +++ b/content/docs/plugins/expect.md @@ -63,4 +63,10 @@ test('add two numbers', ({ expect }) => { }) ``` -In Jest, the `expect` property is available globally. However, with Japa, we recommend you always read it from the Test context. +In Jest, the `expect` property is available globally. However, with Japa, we recommend you always read it from the Test context. If you're getting an error saying `expect` is not available from `TestContext`, make sure you included the bin folder in your `tsconfig.json` file: + +```json +{ + "include": ["bin", "src", "tests"] +} +```