Fix message when plugin of a wrong type is passed (#8950)
This commit is contained in:
parent
0d9e77f559
commit
e85faec47d
@ -132,7 +132,7 @@ function resolveStandardizedName(
|
|||||||
} catch (e2) {}
|
} catch (e2) {}
|
||||||
|
|
||||||
if (resolvedOppositeType) {
|
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;
|
throw e;
|
||||||
|
|||||||
@ -400,7 +400,7 @@ describe("addon resolution", function() {
|
|||||||
presets: ["testplugin"],
|
presets: ["testplugin"],
|
||||||
});
|
});
|
||||||
}).toThrow(
|
}).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\?/,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -414,7 +414,7 @@ describe("addon resolution", function() {
|
|||||||
plugins: ["testpreset"],
|
plugins: ["testpreset"],
|
||||||
});
|
});
|
||||||
}).toThrow(
|
}).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\?/,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user