-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: tests/integration/20.command.functions.test.cjs #5889
refactor: tests/integration/20.command.functions.test.cjs #5889
Conversation
refactor test file to ESM - convert to ESM - replace ava with vitest - replace got with node-fetch Related to: netlify#5698
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AWESOME JOB! 🐳
.buildAsync() | ||
|
||
await withFunctionsServer({ builder }, async () => { | ||
const response = await fetch(`http://localhost:9999/.netlify/functions/ping`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for using fetch
and getting rid of got
!
await builder | ||
.withNetlifyToml({ | ||
config: { | ||
build: { environment: { VITEST_TEST: 'FROM_CONFIG_FILE' } }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: As mentioned in the other PR I would not rename the variable to something that could be set by vitest (to avoid having it set from the testrunner)
I would rename it to something like MY_CONFIG
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
refactor test file to ESM
Summary
Related to: #5698
For us to review and ship your PR efficiently, please perform the following steps:
passes our tests.
A picture of a cute animal (not mandatory, but encouraged)