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

[Docs]: Better explain to contributors how they can execute a test suite #15355

Open
ericmorand opened this issue Oct 23, 2024 · 1 comment
Open

Comments

@ericmorand
Copy link

ericmorand commented Oct 23, 2024

Page(s)

CONTRIBUTING.md

Description

I am currently in the process of trying to add One Double Zero - that restores istanbul accuracy and correctness while using V8 coverage data - as an additional coverage provider for Jest, and for that I've been reading the CONTRIBUTING.md document, at least to understand how I can add some tests for the new provider.

This document says:

It is possible to run the integration test itself manually to inspect that the new behaviour is indeed correct. Here is a small code snippet of how to do just that. This is useful when debugging a failing test.

$ cd e2e/clear-cache
$ node ../../packages/jest-cli/bin/jest.js # It is possible to use `node --inspect`
PASS  __tests__/clear_cache.test.js
✓ stub (3ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        0.232 s, estimated 1 s
Ran all test suites.

Unfortunately, doing what the document explains within the e2e/coverage-provider-v8 directory doesn't work - no test is executed.

Moving deeper, into e2e/coverage-provider-v8/cjs-native-without-sourcemap, the command executes a dummy test that actually checks nothing.

And the following fails:

~/Projects/jest/e2e/__tests__$ node ../../packages/jest-cli/bin/jest.js coverageProviderV8.test.ts

SyntaxError: Cannot use import statement outside a module

It seems like the documentation is either wrong or incomplete.

Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant