forked from redwoodjs/redwood
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(functions): Mock context in function test template (redwoodjs#10555)
- Loading branch information
Showing
3 changed files
with
16 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
- fix(functions): Mock context in function test template (#10555) by @Tobbe | ||
|
||
Currently if you switch on TypeScript strict mode in a Redwood project you will | ||
get red squiggles in our default function tests that we create when users | ||
generate new functions. | ||
|
||
It looks like this | ||
![image](https://github.com/redwoodjs/redwood/assets/30793/b604b9c9-78f1-4e3f-b42f-0f1c1a0d5078) | ||
|
||
The fix is simple, and is the right thing to do no matter if TS strict mode is | ||
enabled or not (or if it's even a TS project or a JS project). We already have | ||
a function to properly mock the Context, so let's just use that! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters