-
Notifications
You must be signed in to change notification settings - Fork 453
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
26 additions
and
34 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,9 +1,9 @@ | ||
console.warn( | ||
'ts-jest', | ||
'[deprecated]', | ||
`Replace any occurrences of "ts-jest/dist/preprocessor.js" or ` + | ||
` "<rootDir>/node_modules/ts-jest/preprocessor.js"` + | ||
` in the 'transform' section of your Jest config with just "ts-jest".`, | ||
'Replace any occurrences of "ts-jest/dist/preprocessor.js" or ' + | ||
' "<rootDir>/node_modules/ts-jest/preprocessor.js"' + | ||
' in the \'transform\' section of your Jest config with just "ts-jest".' | ||
) | ||
|
||
module.exports = require('./dist') |
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,32 +1,24 @@ | ||
const { sync: spawnSync } = require('cross-spawn') | ||
const spawn = require('cross-spawn') | ||
const { satisfies } = require('semver') | ||
const memoize = require('lodash.memoize') | ||
|
||
const self = {} | ||
|
||
Object.defineProperties(self, { | ||
version: { | ||
get: memoize(() => | ||
self | ||
.spawnSync(['-s', '--version']) | ||
.stdout.toString() | ||
.trim(), | ||
), | ||
}, | ||
spawnSync: { | ||
value(args, options = {}) { | ||
return spawnSync('npm', args, options) | ||
}, | ||
}, | ||
can: { | ||
value: Object.defineProperties( | ||
{}, | ||
{ | ||
ci: { get: memoize(() => satisfies(self.version, '>=5.7.0')) }, | ||
prepare: { get: memoize(() => satisfies(self.version, '>=5.7.0')) }, | ||
}, | ||
), | ||
}, | ||
const version = memoize(() => { | ||
return spawnSync(['-s', '--version']) | ||
.stdout.toString() | ||
.trim() | ||
}) | ||
|
||
module.exports = self | ||
const spawnSync = (args, options = {}) => { | ||
return spawn.sync('npm', args, options) | ||
} | ||
|
||
const can = { | ||
ci: memoize(() => satisfies(version(), '>=5.7.0')), | ||
prepare: memoize(() => satisfies(version(), '>=5.7.0')), | ||
} | ||
|
||
module.exports = { | ||
version, | ||
spawnSync, | ||
can, | ||
} |