Prerequisites
Reproduction url
Not available yet.
Reproduction access
Description of the issue
I wanted to enable Rstest prebundling for the jsdom test environment by adding
the new prebundle option:
import { defineConfig } from '@rstest/core';
export default defineConfig({
testEnvironment: {
name: 'jsdom',
prebundle: 'auto',
},
});
After changing testEnvironment from the string form to the object form,
running Knip crashes before it can report its analysis results.
Steps to reproduce
-
Use @rstest/core 0.11.9 and knip 6.24.0.
-
Add the object-form testEnvironment configuration shown above to
rstest.config.ts.
-
Run:
Actual result
Knip terminates with an uncaught TypeError:
TypeError: Cannot read properties of undefined (reading 'startsWith')
at .../knip/dist/WorkspaceWorker.js:410:54
at Array.some (<anonymous>)
at runPlugin (.../knip/dist/WorkspaceWorker.js:410:54)
at async WorkspaceWorker.runPlugins (.../knip/dist/WorkspaceWorker.js:421:33)
at async build (.../knip/dist/graph/build.js:147:35)
at async run (.../knip/dist/run.js:40:109)
at async main (.../knip/dist/cli.js:34:29)
[ELIFECYCLE] Command failed with exit code 1.
Expected result
Knip should complete successfully when Rstest's supported object form of
testEnvironment is used, or report a clear compatibility/configuration error
instead of crashing.
Environment
- Node.js
24.16.0
- pnpm
11.7.0
@rstest/core 0.11.9
knip 6.24.0
Prerequisites
Reproduction url
Not available yet.
Reproduction access
Description of the issue
I wanted to enable Rstest prebundling for the
jsdomtest environment by addingthe new
prebundleoption:After changing
testEnvironmentfrom the string form to the object form,running Knip crashes before it can report its analysis results.
Steps to reproduce
Use
@rstest/core0.11.9andknip6.24.0.Add the object-form
testEnvironmentconfiguration shown above torstest.config.ts.Run:
Actual result
Knip terminates with an uncaught
TypeError:Expected result
Knip should complete successfully when Rstest's supported object form of
testEnvironmentis used, or report a clear compatibility/configuration errorinstead of crashing.
Environment
24.16.011.7.0@rstest/core0.11.9knip6.24.0