Skip to content

Commit

Permalink
Replace glob with tinyglobby in jest-runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
ziebam committed Aug 29, 2024
1 parent e60621e commit 4b4f2a9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/jest-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"chalk": "^4.0.0",
"cjs-module-lexer": "^1.0.0",
"collect-v8-coverage": "^1.0.0",
"glob": "^10.3.10",
"graceful-fs": "^4.2.9",
"jest-haste-map": "workspace:*",
"jest-message-util": "workspace:*",
Expand All @@ -40,7 +39,8 @@
"jest-snapshot": "workspace:*",
"jest-util": "workspace:*",
"slash": "^3.0.0",
"strip-bom": "^4.0.0"
"strip-bom": "^4.0.0",
"tinyglobby": "^0.2.5"
},
"devDependencies": {
"@jest/test-utils": "workspace:*",
Expand Down
5 changes: 2 additions & 3 deletions packages/jest-runtime/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

import * as path from 'path';
import {glob} from 'glob';
import slash = require('slash');
import {globSync} from 'tinyglobby';
import type {Config} from '@jest/types';

const OUTSIDE_JEST_VM_PROTOCOL = 'jest-main:';
Expand Down Expand Up @@ -41,8 +41,7 @@ export const findSiblingsWithFileExtension = (
try {
const slashedDirname = slash(dirname);

const matches = glob
.sync(`${pathToModule}.*`, {windowsPathsNoEscape: true})
const matches = globSync([`${pathToModule}.*`.replaceAll('\\', '/')])
.map(match => slash(match))
.map(match => {
const relativePath = path.posix.relative(slashedDirname, match);
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-runtime/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
// needed for WebAssembly, see https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/826
"lib": ["dom"],
"lib": ["dom", "es2021"],
"rootDir": "src",
"outDir": "build"
},
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13612,7 +13612,6 @@ __metadata:
chalk: ^4.0.0
cjs-module-lexer: ^1.0.0
collect-v8-coverage: ^1.0.0
glob: ^10.3.10
graceful-fs: ^4.2.9
jest-environment-node: "workspace:*"
jest-haste-map: "workspace:*"
Expand All @@ -13624,6 +13623,7 @@ __metadata:
jest-util: "workspace:*"
slash: ^3.0.0
strip-bom: ^4.0.0
tinyglobby: ^0.2.5
languageName: unknown
linkType: soft

Expand Down

0 comments on commit 4b4f2a9

Please sign in to comment.