Skip to content
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

Make Node tests independent (part 2) #1296

Merged
merged 2 commits into from
Jan 4, 2024
Merged

Conversation

ibc
Copy link
Member

@ibc ibc commented Jan 4, 2024

Details

  • Just done in test-Router.ts as POC.
  • Avoid declaring global variables in test files. Put them into ctx: TestContext instead.
  • Things in ctx should be const/frozen or reset in each test() execution.
  • So use a new utils.deepFreeze() function which freezes the object and would throw upon any modification attempt.

### Details

- Just done in `test-Router.ts` as POC.
- Avoid declaring global variables in test files. Put them into `ctx: TestContext` instead.
- Things in `ctx` should be const/frozen or reset in each `test()` execution.
- So use a new `utils.deepFreeze()` function which freezes the object and would throw upon any  modifitation attempt.
@ibc ibc requested a review from jmillan January 4, 2024 11:14
node/src/utils.ts Outdated Show resolved Hide resolved
Co-authored-by: José Luis Millán <[email protected]>
@ibc ibc merged commit e51b47b into v3 Jan 4, 2024
19 checks passed
@ibc ibc deleted the make-node-tests-independent-part-2 branch January 4, 2024 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants