Skip to content

Commit fd2f008

Browse files
committed
nice idea but i dont wanna spend 1000000 hours on typescript docs
1 parent 1a7042c commit fd2f008

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ public/
77
*.map
88
.bob/
99
*.log
10-
jest-resolver.cjs

jest-resolver.cts renamed to jest-resolver.cjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
import { ResolverOptions } from 'jest-resolve';
1+
// @ts-check
22

33
/** This is module.exports for a reason. Please don't change it. */
4-
module.exports = function jestResolver(path: string, options: ResolverOptions) {
4+
/**
5+
* @param {string} path
6+
* @param {import("jest-resolve").ResolverOptions} options
7+
*/
8+
module.exports = function jestResolver(path, options) {
59
/**
610
* Jest does not like .js extensions when not running Jest in EXPERIMENTAL AND TOTALLY UNSTABLE YELL-AT-YA esm mode.
711
* We rewrite it so we can run the tests.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
"README.md"
3030
],
3131
"scripts": {
32-
"build": "rimraf dist && tsc && yarn build:jest-resolver",
33-
"build:jest-resolver": "rimraf jest-resolver.cjs && tsc jest-resolver.cts",
32+
"build": "rimraf dist && tsc",
3433
"lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --ignore-path .gitignore .",
3534
"lint:prettier": "prettier --cache --check .",
3635
"prepublish": "yarn build",

test/jest-resolver.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, it, test } from 'vitest';
2-
import jestResolver from '../jest-resolver';
2+
import * as jestResolver from '../jest-resolver.cjs';
33

44
test('jest-resolver', () => {
55
it('removes .js extension from relative paths', () => {

0 commit comments

Comments
 (0)