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

Migrate legacy reference test to node test runner #2118

Merged
merged 12 commits into from
Jul 24, 2023

Conversation

sammacbeth
Copy link
Collaborator

@sammacbeth sammacbeth commented Jul 19, 2023

Description:

  • After migrating to ESBuild, we were left with some tests that still needed browserify to build, primarily because they use jsdom.
  • We should ideally run these tests in node, as running jsdom in the browser (the normal unit-test environment) is a hack.
  • This PR moves those remaining reference-tests to a new unit-test environment, that bundles the tests with ESBuild, but targeting node, and runs them with jasmine.
  • As the test framework is the same (jasmine), these tests can be written in the same way as the normal unit-tests. The run context (node vs browser) depends on which folder they are in under the unit-tests dir: unit-test/node -> run in node, other folders are run in the browser.
  • We might want to migrate other tests to the node runner at some point, as it's much faster.

Requires duckduckgo/content-scope-scripts#643 and duckduckgo/privacy-reference-tests#104 for tests to pass.

@sammacbeth sammacbeth merged commit d2646f5 into duckduckgo:main Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants