webpro-nl / knip

✂️ Find unused files, dependencies and exports in your JavaScript and TypeScript projects. Knip it before you ship it!
https://knip.dev
ISC License
7.06k stars 177 forks source link

jest: support custom testEnvironment #834

Closed tryggvigy closed 1 week ago

tryggvigy commented 1 week ago

This PR

Adds support for custom testEnvironment files like:

  testEnvironment:
    '<rootDir>/tests/framework/e2e/jest-environments/E2EEnvironment.ts',

I get a unit test failure on the cli version when running the tests locally. Maybe it'll pass in CI. Anyone know how to fix that?

image
pkg-pr-new[bot] commented 1 week ago

Open in Stackblitz

bun add https://pkg.pr.new/knip@834

commit: b80e392

webpro commented 1 week ago

I get a unit test failure on the cli version when running the tests locally. Maybe it'll pass in CI. Anyone know how to fix that?

I think it's because of a previous build, you can run bun build and it should be alright (the cli tests use the built dist version).

webpro commented 1 week ago

Thanks @tryggvigy! Nested ternaries aren't marvellous, but heck.

webpro commented 1 week ago

:rocket: This pull request is included in v5.37.0. See Release 5.37.0 for release notes.

Using Knip in a commercial project? Please consider becoming a sponsor.