Skip to content

Commit

Permalink
fix: add runtime field of jest config
Browse files Browse the repository at this point in the history
  • Loading branch information
decadef20 committed May 21, 2024
1 parent c3adf19 commit 5c42fbd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/knip/fixtures/plugins/jest/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ module.exports = {
],
testResultsProcessor: 'jest-phabricator',
snapshotResolver: '<rootDir>/snapshotResolver.js',
runtime: '@side/jest-runtime',
};
2 changes: 2 additions & 0 deletions packages/knip/src/plugins/jest/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const resolveDependencies = async (config: JestInitialOptions, options: PluginOp
const snapshotResolver = config.snapshotResolver ? [config.snapshotResolver] : [];
const testSequencer = config.testSequencer ? [config.testSequencer] : [];
const globalSetup = config.globalSetup ? [config.globalSetup] : [];
const runtime = config.runtime ? [config.runtime] : [];

return [
...presets,
Expand All @@ -93,6 +94,7 @@ const resolveDependencies = async (config: JestInitialOptions, options: PluginOp
...snapshotResolver,
...testSequencer,
...globalSetup,
...runtime,
];
};

Expand Down
2 changes: 1 addition & 1 deletion packages/knip/test/plugins/jest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ test('Find dependencies with the Jest plugin', async () => {
assert.deepEqual(counters, {
...baseCounters,
devDependencies: 1,
unlisted: 10,
unlisted: 11,
unresolved: 1,
processed: 6,
total: 6,
Expand Down

0 comments on commit 5c42fbd

Please sign in to comment.