This encapsulates the logic for turning an acceptable plugin name into the absolute path for that plugin. It can be used to preprocess a plugins list to map each plugin to its absolute path, which is necessary if `babel.transform` is going to be executed on a file outside the directory subtree where the plugins are installed. This adds a getPossiblePluginNames helper encapsulating the logic for what plugin names we should try to resolve, and the resolvePlugin method just calls this helper and actually resolves them.
9 lines
331 B
JavaScript
9 lines
331 B
JavaScript
let assert = require("assert");
|
|
let getPossiblePluginNames = require("../lib/helpers/get-possible-plugin-names");
|
|
|
|
describe("getPossiblePluginNames", function () {
|
|
it("adds the babel-plugin prefix", function() {
|
|
assert.deepEqual(getPossiblePluginNames("foobar"), ["babel-plugin-foobar", "foobar"]);
|
|
});
|
|
});
|