Repository: depcheck/depcheck (js)

Issue:
Short name for Jest `testEnvironment` doesn't seem to be recognised
### Bug Description

Jest special supports short names for runners and watch plugins, but not for the test environment https://github.com/depcheck/depcheck/blob/77fe0e2d092bdc8b97b65e37955f59be8a436d19/src/special/jest.js#L69-L75

### Code snippets

Where the dependency is used:

```
// jest.config.js
testEnvironment: 'jsdom',
```

Where the dependency is listed in package.json:

```
// devDependencies
"jest-environment-jsdom": "^29.6.3",
```

### Versions

- `node -v`: 18.17.0
- `npm -v`: 9.6.7
- `depcheck --version`: 1.4.7

### Extra info

Any extra info you want to include. Thank you for the bug report!

BONUS POINTS: If you wish to help us debug further, the `depcheck --json` option will show more information. Check [here in the README](https://github.com/depcheck/depcheck#example) for documentation on json output.


Pull request description:
fix: support short name for Jest test environments
Fix #857

Patch:
diff --git a/src/special/jest.js b/src/special/jest.js
index 3363f0c..0f732d6 100644
--- a/src/special/jest.js
+++ b/src/special/jest.js
@@ -74,6 +74,10 @@ function filter(deps, options) {
     contain(options.watchPlugins, dep, 'jest-watch-'),
   );
 
+  const testEnvironment = deps.filter((dep) =>
+    contain(options.testEnvironment, dep, 'jest-environment-'),
+  );
+
   const otherProps = lodash(options)
     .entries()
     .map(([prop, value]) => {
@@ -89,7 +93,9 @@ function filter(deps, options) {
     .intersection(deps)
     .value();
 
-  return _.uniq(runner.concat(watchPlugins).concat(otherProps));
+  return _.uniq(
+    runner.concat(watchPlugins).concat(testEnvironment).concat(otherProps),
+  );
 }
 
 function checkOptions(deps, options = {}) {


Test patch:
diff --git a/test/special/jest.js b/test/special/jest.js
index 6ed11e2..0e397f1 100644
--- a/test/special/jest.js
+++ b/test/special/jest.js
@@ -52,6 +52,16 @@ const testCases = [
     deps: ['jest-watch-master', 'jest-watch-select-projects'],
     content: { watchPlugins: ['master', 'select-projects'] },
   },
+  {
+    name: 'recognize single short-name test environment',
+    deps: ['jest-environment-jsdom'],
+    content: { testEnvironment: 'jsdom' },
+  },
+  {
+    name: 'recognize single long-name test environment',
+    deps: ['jest-environment-jsdom'],
+    content: { testEnvironment: 'jest-environment-jsdom' },
+  },
   {
     name: 'recognize module with options',
     deps: ['jest-watch-master'],