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

chore: run test in Node.js #5258

Merged
merged 7 commits into from
Jul 4, 2024
Merged

chore: run test in Node.js #5258

merged 7 commits into from
Jul 4, 2024

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented Jul 2, 2024

An experimental PR to run test cases in Node.js

This change collects the test definitions using npm:@deno/shim-deno-test, and passes the collected test definitions to test API of node:test

prerequisite for #4313

$ deno task test:node
Task test:node node --import ./_tools/node_test_runner/register_deno_shim.mjs ./_tools/node_test_runner/run_test.mjs
✔ aggregateGroups() handles no mutation (0.638417ms)
✔ aggregateGroups() handles string building using all params (0.131375ms)
✔ aggregateGroups() handles sum ignoring non reduce params (0.067958ms)
✔ aggregateGroups() handles empty input (0.153834ms)
✔ associateBy() handles no mutation (0.093292ms)
✔ associateBy() handles empty input (0.045042ms)
✔ associateBy() handles constant key (0.110167ms)
✔ associateBy() handles empty key (0.054667ms)
✔ associateBy() handles duplicate keys (0.226125ms)
✔ associateBy() handles associates (0.253958ms)
✔ associateWith() handles no mutation (0.065542ms)
✔ associateWith() handles empty input (0.041208ms)
✔ associateWith() handles associates (0.104ms)
✔ associateWith() handles duplicate keys (0.048542ms)
ℹ tests 14
ℹ suites 0
ℹ pass 14
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 6.968459

You need to run npm install in _tools/node_test_runner directory before running deno task test:node

Copy link

codecov bot commented Jul 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.76%. Comparing base (fc2975b) to head (fa5afa3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5258   +/-   ##
=======================================
  Coverage   95.76%   95.76%           
=======================================
  Files         457      457           
  Lines       37955    37955           
  Branches     5569     5569           
=======================================
  Hits        36346    36346           
  Misses       1568     1568           
  Partials       41       41           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kt3k kt3k marked this pull request as ready for review July 3, 2024 01:46
Copy link
Contributor

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! I think once we have this tool in good shape, we should somehow make available for users.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
kt3k and others added 2 commits July 4, 2024 12:57
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
@kt3k kt3k merged commit 10be0e3 into denoland:main Jul 4, 2024
13 checks passed
@kt3k kt3k deleted the run-test-in-node-js branch July 4, 2024 05:36
@kt3k
Copy link
Member Author

kt3k commented Jul 4, 2024

Very nice! I think once we have this tool in good shape, we should somehow make available for users.

Sounds a good idea, but at this point I have no idea how to resolve the external dependencies. This implementation doesn't include the resolution of jsr: specifier because std doesn't have external dependencies.

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