Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update cjs-module-lexer #10764

Merged
merged 1 commit into from Nov 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/jest-runtime/package.json
Expand Up @@ -20,7 +20,7 @@
"@jest/types": "^26.6.1",
"@types/yargs": "^15.0.0",
"chalk": "^4.0.0",
"cjs-module-lexer": "^0.4.2",
"cjs-module-lexer": "^0.6.0",
"collect-v8-coverage": "^1.0.0",
"exit": "^0.1.2",
"glob": "^7.1.3",
Expand Down
4 changes: 1 addition & 3 deletions packages/jest-runtime/src/index.ts
Expand Up @@ -18,8 +18,7 @@ import {
// @ts-expect-error: experimental, not added to the types
Module as VMModule,
} from 'vm';
// @ts-expect-error
import parseCjs = require('cjs-module-lexer');
import {parse as parseCjs} from 'cjs-module-lexer';
import {CoverageInstrumenter, V8Coverage} from 'collect-v8-coverage';
import * as fs from 'graceful-fs';
import stripBOM = require('strip-bom');
Expand Down Expand Up @@ -505,7 +504,6 @@ class Runtime {
if (transformedCode) {
const {exports} = parseCjs(transformedCode.code);

// @ts-expect-error
cjsExports = exports.filter(exportName => {
// we don't wanna respect any exports _names_ default as a named export
if (exportName === 'default') {
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Expand Up @@ -5809,10 +5809,10 @@ __metadata:
languageName: node
linkType: hard

"cjs-module-lexer@npm:^0.4.2":
version: 0.4.3
resolution: "cjs-module-lexer@npm:0.4.3"
checksum: ee3e1707c877c6c38577210037c6735499739cd4055c51dc224a4d71ecb901cd6460281d1497fbcc20ac1291f4cab7f5cdcd3713ea244aa55625f3607237d301
"cjs-module-lexer@npm:^0.6.0":
version: 0.6.0
resolution: "cjs-module-lexer@npm:0.6.0"
checksum: 333671db7fb916d9c569a52fba714a86051881c69a4df784a07cb1dfec2a1796c7bcd7ba46ff9035cccb6e7aaff612a83f6505437c01a5ae14c4ebc6c36f762c
languageName: node
linkType: hard

Expand Down Expand Up @@ -11968,7 +11968,7 @@ fsevents@^1.2.7:
"@types/node": ^14.0.27
"@types/yargs": ^15.0.0
chalk: ^4.0.0
cjs-module-lexer: ^0.4.2
cjs-module-lexer: ^0.6.0
collect-v8-coverage: ^1.0.0
execa: ^4.0.0
exit: ^0.1.2
Expand Down