-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: Drop support for Jest v26 BREAKING CHANGE: Module is now written in native ESM
- Loading branch information
Showing
11 changed files
with
148 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,27 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies | ||
const semver = require('semver'); | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const pkg = require('./package.json'); | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import semver from 'semver'; | ||
import { readFileSync } from 'fs'; | ||
|
||
let pkg = readFileSync('./package.json', 'utf8'); | ||
|
||
pkg = JSON.parse(pkg); | ||
|
||
const supportedNodeVersion = semver.minVersion(pkg.engines.node).version; | ||
|
||
module.exports = { | ||
export default { | ||
ignore: ['**/__mocks__/**'], | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
modules: false, | ||
targets: { node: supportedNodeVersion }, | ||
}, | ||
], | ||
'@babel/preset-typescript', | ||
], | ||
plugins: | ||
process.env.NODE_ENV === 'test' | ||
? [] | ||
: ['babel-plugin-add-import-extension'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const FileNamePlugin = require('./build/file_name_plugin/plugin').default; | ||
|
||
module.exports = FileNamePlugin; | ||
export { default } from './build/file_name_plugin/plugin.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
"./testname": "./build/test_name_plugin/plugin.js", | ||
"./package.json": "./package.json" | ||
}, | ||
"type": "module", | ||
"author": "Rogelio Guzman <[email protected]>", | ||
"description": "Jest plugin for filtering by filename or test name", | ||
"license": "MIT", | ||
|
@@ -22,7 +23,7 @@ | |
"testname.js" | ||
], | ||
"scripts": { | ||
"test": "jest", | ||
"test": "cross-env NODE_OPTIONS=\"--experimental-vm-modules\" jest", | ||
"lint": "eslint .", | ||
"prebuild": "rimraf build", | ||
"build": "babel --extensions .js,.ts src -d build && rimraf **/*.test.{js,ts},integration build/**/__tests__ build/test_utils", | ||
|
@@ -35,15 +36,16 @@ | |
"chalk": "^4.0.0", | ||
"jest-regex-util": "^27.0.0", | ||
"jest-watcher": "^27.0.0", | ||
"slash": "^3.0.0", | ||
"string-length": "^4.0.1", | ||
"strip-ansi": "^6.0.0" | ||
"slash": "^4.0.0", | ||
"string-length": "^5.0.1", | ||
"strip-ansi": "^7.0.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.8.4", | ||
"@babel/core": "^7.9.6", | ||
"@babel/preset-env": "^7.9.6", | ||
"@babel/preset-typescript": "^7.10.4", | ||
"@jest/globals": "^27.2.3", | ||
"@jest/types": "^27.0.0", | ||
"@semantic-release/changelog": "^5.0.1", | ||
"@semantic-release/git": "^9.0.0", | ||
|
@@ -52,12 +54,14 @@ | |
"@typescript-eslint/eslint-plugin": "^4.0.1", | ||
"@typescript-eslint/parser": "^4.0.1", | ||
"babel-jest": "^27.0.0", | ||
"babel-plugin-add-import-extension": "^1.6.0", | ||
"cross-env": "^7.0.3", | ||
"eslint": "^7.8.1", | ||
"eslint-config-airbnb-base": "^14.1.0", | ||
"eslint-config-prettier": "^8.0.0", | ||
"eslint-plugin-import": "^2.20.2", | ||
"eslint-plugin-jest": "^24.0.0", | ||
"eslint-plugin-prettier": "^3.1.3", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"jest": "^27.0.0", | ||
"prettier": "^2.1.1", | ||
"rimraf": "^3.0.2", | ||
|
@@ -66,9 +70,12 @@ | |
"typescript": "^4.0.2" | ||
}, | ||
"peerDependencies": { | ||
"jest": "^26.0.0 || ^27.0.0" | ||
"jest": "^27.0.0" | ||
}, | ||
"jest": { | ||
"extensionsToTreatAsEsm": [ | ||
".ts" | ||
], | ||
"watchPlugins": [ | ||
"<rootDir>/filename", | ||
"<rootDir>/testname" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const TestNamePlugin = require('./build/test_name_plugin/plugin').default; | ||
|
||
module.exports = TestNamePlugin; | ||
export { default } from './build/test_name_plugin/plugin.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters