Skip to content

Commit

Permalink
Provide default value for transform property in ScriptTransformer
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Aug 17, 2019
1 parent ef7000c commit 3950754
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/jest-transform/src/ScriptTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -658,17 +658,17 @@ const calcIgnorePatternRegExp = (config: Config.ProjectConfig) => {
return new RegExp(config.transformIgnorePatterns.join('|'));
};

const calcTransformRegExp = (config: Config.ProjectConfig) => {
if (!config.transform.length) {
const calcTransformRegExp = ({transform = []}: Config.ProjectConfig) => {
if (!transform.length) {
return undefined;
}

const transformRegexp: Array<[RegExp, string, Record<string, unknown>]> = [];
for (let i = 0; i < config.transform.length; i++) {
for (let i = 0; i < transform.length; i++) {
transformRegexp.push([
new RegExp(config.transform[i][0]),
config.transform[i][1],
config.transform[i][2],
new RegExp(transform[i][0]),
transform[i][1],
transform[i][2],
]);
}

Expand Down

0 comments on commit 3950754

Please sign in to comment.