-
Notifications
You must be signed in to change notification settings - Fork 4
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
Standardise conditional testing fix #437
Conversation
Moved `tests/utils.ts` to `tests/utils/utils.ts` and created `test/utils/index.ts`. Trying to keep the utils within one place. Removed `setupGlobalAgent` code, #420 means it isn't used anymore. Updating how we handle conditional testing utility's. we're switching to using reified booleans and just composing conditional boolean expression. #434
👇 Click on the image for a new way to code review
Legend |
Can you make sure |
You can use https://eslint.org/docs/latest/rules/no-restricted-globals to add a restriction to |
I think the PR still needs a task list to be ticked off. The PR can have tasks that indicate pending things to be done that isn't about the issue. |
I didn't include the task list here since this PR leans more to review than drafting out the problem. I'll add it back in but any |
Creating `isPlatformX`, `isTestPlatformX` and `hasX` booleans to use for enabling tests. Replaced usage of describeIf to use testIf for the tests within the describe block. This means jest shouldn't complain about empty test files if no tests run. #434
…rms`, replaced with `testIf` We're replacing these with `testIf` and `describeIf` and reified booleans. #434
6b79205
to
3bf5658
Compare
I just did a quick check, and it is actually:
That is the most common. Not:
So I guess we keep it as This is because I can see there are other similar Hard to remember cause the directory is |
3bf5658
to
610fe52
Compare
Changed it to |
We should be using `globalThis` to access global variables. A linting rule has been added to restrict usage of `global`.
610fe52
to
8ae818b
Compare
I'm re-triggering agent/service and nat tests in CI. Seems like they failed due to timeouts. It's just 3 tests in total so I think we're good to merge here. |
They timed out again.
I don't think there's a problem with the tests themselves. I know the Want me to look into it now or merge now and fix later? |
Ok leaving the time outs to a later PRs. |
Description
This PR standardises how conditional testing with
testIf
anddescribeIf
is used with new reified booleans.Issues Fixed
Final checklist