Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it(fixtureName, function () {
var fixturePath = path.resolve(__dirname, 'fixtures', fixtureName, 'fixture.js');
var expectedPath = path.resolve(__dirname, 'fixtures', fixtureName, 'expected.js');
var actual = babel.transformFileSync(fixturePath, {
optional: ['es7.decorators'],
plugins: ['../lib'],
externalHelpers: true
}).code;
var expected = fs.readFileSync(expectedPath, { encoding: 'utf8' });
assert.equal(actual + '\n', expected);
});
}
function transform(path, extra) {
return babel.transformFileSync(path, {
blacklist: ['strict', 'react'],
plugins: [plugin],
extra: extra
}).code;
}
function runTest() {
var output = babel.transformFileSync(actualPath, {
sourceMaps: true,
optional: ['runtime'],
plugins: [
require(pluginPath)({
"registratorName": "loc_h8tz9yd7f1zl4t3711yc",
"blackbox": ["**/fixtures/**"]
})
]
});
var expected = fs.readFileSync(expectedPath, 'utf-8').replace(/\{\{(.*)\}\}/g, actualPath);
diff.diffLines(
normalizeLines(output.code),
normalizeLines(expected)
)
loadPlayer() {
eval(babel.transformFileSync(path.join(this.getPlayerPath(), 'Player.js')).code);
}
'stage' : 0,
'blacklist': [
'react',
'es7.comprehensions',
'es7.doExpressions',
'es7.functionBind',
'es7.objectRestSpread',
'es7.trailingFunctionCommas'
],
'loose' : true,
'optional': ['runtime'],
'modules' : 'common'
};
for (const filePath of appFiles) {
const {code} = transformFileSync(filePath, babelOptions);
const filename = path.relative(this.userRootPath, filePath);
const outFile = path.join(outPath, filename);
fs.outputFileSync(outFile, code);
outFiles.push(outFile);
}
return outFiles;
}