Migrate to jest (#7455)
This commit is contained in:
@@ -122,7 +122,13 @@ const buildTest = function(binName, testName, opts) {
|
||||
const binLoc = path.join(__dirname, "../lib", binName);
|
||||
|
||||
return function(callback) {
|
||||
clear();
|
||||
const dir = process.cwd();
|
||||
|
||||
process.chdir(__dirname);
|
||||
if (fs.existsSync(tmpLoc)) rimraf.sync(tmpLoc);
|
||||
fs.mkdirSync(tmpLoc);
|
||||
process.chdir(tmpLoc);
|
||||
|
||||
saveInFiles(opts.inFiles);
|
||||
|
||||
let args = [binLoc];
|
||||
@@ -160,6 +166,7 @@ const buildTest = function(binName, testName, opts) {
|
||||
args.map(arg => `"${arg}"`).join(" ") + ": " + err.message;
|
||||
}
|
||||
|
||||
process.chdir(dir);
|
||||
callback(err);
|
||||
});
|
||||
|
||||
@@ -170,13 +177,6 @@ const buildTest = function(binName, testName, opts) {
|
||||
};
|
||||
};
|
||||
|
||||
const clear = function() {
|
||||
process.chdir(__dirname);
|
||||
if (fs.existsSync(tmpLoc)) rimraf.sync(tmpLoc);
|
||||
fs.mkdirSync(tmpLoc);
|
||||
process.chdir(tmpLoc);
|
||||
};
|
||||
|
||||
fs.readdirSync(fixtureLoc).forEach(function(binName) {
|
||||
if (binName[0] === ".") return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user