Fixed #1 - Fixed the whatsnew-** script for loading release notes into builds
Added test to ensure that release notes are parsed properly Updated to latest dependencies to fix security vulnerability Updated GH Actions Workflow to run test before updating tag Updated README.md to reflect proper whatsnew documentation.
This commit is contained in:
105
node_modules/jest-config/build/normalize.js
generated
vendored
105
node_modules/jest-config/build/normalize.js
generated
vendored
@@ -178,15 +178,26 @@ const createConfigError = message =>
|
||||
ERROR,
|
||||
message,
|
||||
_utils.DOCUMENTATION_NOTE
|
||||
);
|
||||
); // TS 3.5 forces us to split these into 2
|
||||
|
||||
const mergeOptionWithPreset = (options, preset, optionName) => {
|
||||
if (options[optionName] && preset[optionName]) {
|
||||
options[optionName] = _objectSpread(
|
||||
const mergeModuleNameMapperWithPreset = (options, preset) => {
|
||||
if (options['moduleNameMapper'] && preset['moduleNameMapper']) {
|
||||
options['moduleNameMapper'] = _objectSpread(
|
||||
{},
|
||||
options[optionName],
|
||||
preset[optionName],
|
||||
options[optionName]
|
||||
options['moduleNameMapper'],
|
||||
preset['moduleNameMapper'],
|
||||
options['moduleNameMapper']
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const mergeTransformWithPreset = (options, preset) => {
|
||||
if (options['transform'] && preset['transform']) {
|
||||
options['transform'] = _objectSpread(
|
||||
{},
|
||||
options['transform'],
|
||||
preset['transform'],
|
||||
options['transform']
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -253,8 +264,8 @@ const setupPreset = (options, optionsPreset) => {
|
||||
);
|
||||
}
|
||||
|
||||
mergeOptionWithPreset(options, preset, 'moduleNameMapper');
|
||||
mergeOptionWithPreset(options, preset, 'transform');
|
||||
mergeModuleNameMapperWithPreset(options, preset);
|
||||
mergeTransformWithPreset(options, preset);
|
||||
return _objectSpread({}, preset, options);
|
||||
};
|
||||
|
||||
@@ -271,28 +282,27 @@ const setupBabelJest = options => {
|
||||
const regex = new RegExp(pattern);
|
||||
return regex.test('a.ts') || regex.test('a.tsx');
|
||||
});
|
||||
[customJSPattern, customTSPattern].forEach(pattern => {
|
||||
if (pattern) {
|
||||
const customTransformer = transform[pattern];
|
||||
|
||||
if (customJSPattern) {
|
||||
const customJSTransformer = transform[customJSPattern];
|
||||
|
||||
if (customJSTransformer === 'babel-jest') {
|
||||
babelJest = require.resolve('babel-jest');
|
||||
transform[customJSPattern] = babelJest;
|
||||
} else if (customJSTransformer.includes('babel-jest')) {
|
||||
babelJest = customJSTransformer;
|
||||
if (Array.isArray(customTransformer)) {
|
||||
if (customTransformer[0] === 'babel-jest') {
|
||||
babelJest = require.resolve('babel-jest');
|
||||
customTransformer[0] = babelJest;
|
||||
} else if (customTransformer[0].includes('babel-jest')) {
|
||||
babelJest = customTransformer[0];
|
||||
}
|
||||
} else {
|
||||
if (customTransformer === 'babel-jest') {
|
||||
babelJest = require.resolve('babel-jest');
|
||||
transform[pattern] = babelJest;
|
||||
} else if (customTransformer.includes('babel-jest')) {
|
||||
babelJest = customTransformer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (customTSPattern) {
|
||||
const customTSTransformer = transform[customTSPattern];
|
||||
|
||||
if (customTSTransformer === 'babel-jest') {
|
||||
babelJest = require.resolve('babel-jest');
|
||||
transform[customTSPattern] = babelJest;
|
||||
} else if (customTSTransformer.includes('babel-jest')) {
|
||||
babelJest = customTSTransformer;
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
babelJest = require.resolve('babel-jest');
|
||||
options.transform = {
|
||||
@@ -738,14 +748,20 @@ function normalize(options, argv, configPath, projectIndex = Infinity) {
|
||||
const transform = oldOptions[key];
|
||||
value =
|
||||
transform &&
|
||||
Object.keys(transform).map(regex => [
|
||||
regex,
|
||||
(0, _utils.resolve)(newOptions.resolver, {
|
||||
filePath: transform[regex],
|
||||
key,
|
||||
rootDir: options.rootDir
|
||||
})
|
||||
]);
|
||||
Object.keys(transform).map(regex => {
|
||||
const transformElement = transform[regex];
|
||||
return [
|
||||
regex,
|
||||
(0, _utils.resolve)(newOptions.resolver, {
|
||||
filePath: Array.isArray(transformElement)
|
||||
? transformElement[0]
|
||||
: transformElement,
|
||||
key,
|
||||
rootDir: options.rootDir
|
||||
}),
|
||||
...(Array.isArray(transformElement) ? [transformElement[1]] : [])
|
||||
];
|
||||
});
|
||||
break;
|
||||
|
||||
case 'coveragePathIgnorePatterns':
|
||||
@@ -920,6 +936,19 @@ function normalize(options, argv, configPath, projectIndex = Infinity) {
|
||||
break;
|
||||
}
|
||||
|
||||
case 'testTimeout': {
|
||||
if (oldOptions[key] < 0) {
|
||||
throw createConfigError(
|
||||
` Option "${_chalk().default.bold(
|
||||
'testTimeout'
|
||||
)}" must be a natural number.`
|
||||
);
|
||||
}
|
||||
|
||||
value = oldOptions[key];
|
||||
break;
|
||||
}
|
||||
|
||||
case 'automock':
|
||||
case 'browser':
|
||||
case 'cache':
|
||||
@@ -1041,7 +1070,7 @@ function normalize(options, argv, configPath, projectIndex = Infinity) {
|
||||
? 'all'
|
||||
: 'new';
|
||||
newOptions.maxConcurrency = parseInt(newOptions.maxConcurrency, 10);
|
||||
newOptions.maxWorkers = (0, _getMaxWorkers.default)(argv);
|
||||
newOptions.maxWorkers = (0, _getMaxWorkers.default)(argv, options);
|
||||
|
||||
if (newOptions.testRegex.length && options.testMatch) {
|
||||
throw createConfigError(
|
||||
|
||||
Reference in New Issue
Block a user