Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions common/config/subspaces/build-tests-subspace/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
{
"pnpmShrinkwrapHash": "e12ac931528bca6b851ff4e4bbe8df7c7463449c",
"pnpmShrinkwrapHash": "54cea496681584cbbaed2572d3fbe0b8190a01e5",
"preferredVersionsHash": "550b4cee0bef4e97db6c6aad726df5149d20e7d9",
"packageJsonInjectedDependenciesHash": "10959d629cddc9df960467f98e5cf3982e69f38d"
"packageJsonInjectedDependenciesHash": "ee2b3b71bdf017198644d741cf5152fa01ff931b"
}
47 changes: 47 additions & 0 deletions heft-plugins/heft-jest-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,53 @@

This is a Heft plugin for running Jest.

## VSCode Jest Extension Integration

This package includes a `heft-jest` CLI wrapper that enables integration with the
[VSCode Jest extension](https://github.com/jest-community/vscode-jest). The wrapper translates
Jest CLI parameters to Heft CLI parameters, allowing the extension to work with Heft's test
runner.

### Setup

To use the VSCode Jest extension with Heft, configure the extension's `jest.jestCommandLine`
setting in your VSCode workspace settings (`.vscode/settings.json`):

```json
{
"jest.jestCommandLine": "npx heft-jest"
}
```

Or, if you have `@rushstack/heft-jest-plugin` installed globally or linked:

```json
{
"jest.jestCommandLine": "heft-jest"
}
```

### How It Works

The `heft-jest` CLI accepts Jest CLI parameters commonly sent by the VSCode Jest extension and
translates them to equivalent Heft parameters. For example:

| Jest Parameter | Heft Parameter |
|----------------|----------------|
| `--testPathPattern` | `--test-path-pattern` |
| `--testNamePattern` or `-t` | `--test-name-pattern` |
| `--updateSnapshot` or `-u` | `--update-snapshots` |
| `--maxWorkers` | `--max-workers` |
| `--testTimeout` | `--test-timeout-ms` |
| `--no-coverage` | `--disable-code-coverage` |
| `--detectOpenHandles` | `--detect-open-handles` |
| `--silent` | `--silent` |
| `--logHeapUsage` | `--log-heap-usage` |
| `--watchAll` / `--watch` | Uses `heft test-watch` instead of `heft test` |

Parameters specific to the VSCode Jest extension (like `--json`, `--outputFile`, `--reporters`)
are automatically filtered out.

## Links

- [CHANGELOG.md](
Expand Down
2 changes: 2 additions & 0 deletions heft-plugins/heft-jest-plugin/bin/heft-jest
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env node
require('../lib/heft-jest-cli.js');
3 changes: 3 additions & 0 deletions heft-plugins/heft-jest-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
},
"homepage": "https://rushstack.io/pages/heft/overview/",
"license": "MIT",
"bin": {
"heft-jest": "./bin/heft-jest"
},
"scripts": {
"build": "heft test --clean",
"start": "heft build-watch",
Expand Down
Loading