Skip to content

Commit

Permalink
Fix message when plugin of a wrong type is passed (#8950)
Browse files Browse the repository at this point in the history
  • Loading branch information
everdimension authored and existentialism committed Oct 31, 2018
1 parent 0d9e77f commit e85faec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/babel-core/src/config/files/plugins.js
Expand Up @@ -132,7 +132,7 @@ function resolveStandardizedName(
} catch (e2) {}

if (resolvedOppositeType) {
e.message += `\n- Did you accidentally pass a ${type} as a ${oppositeType}?`;
e.message += `\n- Did you accidentally pass a ${oppositeType} as a ${type}?`;
}

throw e;
Expand Down
4 changes: 2 additions & 2 deletions packages/babel-core/test/resolution.js
Expand Up @@ -400,7 +400,7 @@ describe("addon resolution", function() {
presets: ["testplugin"],
});
}).toThrow(
/Cannot find module 'babel-preset-testplugin'.*\n- Did you accidentally pass a preset as a plugin\?/,
/Cannot find module 'babel-preset-testplugin'.*\n- Did you accidentally pass a plugin as a preset\?/,
);
});

Expand All @@ -414,7 +414,7 @@ describe("addon resolution", function() {
plugins: ["testpreset"],
});
}).toThrow(
/Cannot find module 'babel-plugin-testpreset'.*\n- Did you accidentally pass a plugin as a preset\?/,
/Cannot find module 'babel-plugin-testpreset'.*\n- Did you accidentally pass a preset as a plugin\?/,
);
});

Expand Down

0 comments on commit e85faec

Please sign in to comment.