From 1786c69e5f6f3b3dbc53b1e4e4fecab889a58542 Mon Sep 17 00:00:00 2001 From: Vsevolod Strukchinsky Date: Sat, 7 Nov 2015 16:47:33 +0500 Subject: [PATCH] add ava modules to test module paths Closes #144 --- lib/babel.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/babel.js b/lib/babel.js index 84af5b977e..b8e5f7e1c9 100644 --- a/lib/babel.js +++ b/lib/babel.js @@ -2,6 +2,7 @@ var resolveFrom = require('resolve-from'); var createEspowerPlugin = require('babel-plugin-espower/create'); var requireFromString = require('require-from-string'); +var resolve = require('path').resolve; var hasGenerators = parseInt(process.version.slice(1), 10) > 0; var path = process.argv[2]; @@ -25,4 +26,6 @@ var options = { }; var transpiled = babel.transformFileSync(path, options); -requireFromString(transpiled.code, path); +requireFromString(transpiled.code, path, { + appendPaths: [resolve('../node_modules')] +});