Ensure that tests don't leave mutated global state in the environment.
This commit is contained in:
@@ -177,6 +177,16 @@ fs.readdirSync(fixtureLoc).forEach(function(binName) {
|
||||
|
||||
const suiteLoc = path.join(fixtureLoc, binName);
|
||||
describe("bin/" + binName, function() {
|
||||
let cwd;
|
||||
|
||||
beforeEach(() => {
|
||||
cwd = process.cwd();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
process.chdir(cwd);
|
||||
});
|
||||
|
||||
fs.readdirSync(suiteLoc).forEach(function(testName) {
|
||||
if (testName[0] === ".") return;
|
||||
|
||||
|
||||
@@ -76,6 +76,16 @@ const buildTest = opts => {
|
||||
};
|
||||
|
||||
describe("debug output", () => {
|
||||
let cwd;
|
||||
|
||||
beforeEach(() => {
|
||||
cwd = process.cwd();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
process.chdir(cwd);
|
||||
});
|
||||
|
||||
fs.readdirSync(fixtureLoc).forEach(testName => {
|
||||
if (testName.slice(0, 1) === ".") return;
|
||||
const testLoc = path.join(fixtureLoc, testName);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"presets": [
|
||||
["../../../../lib", {
|
||||
"configPath": "../fixtures/preset-options/browserslist-config",
|
||||
"configPath": "packages/babel-preset-env/test/fixtures/preset-options/browserslist-config",
|
||||
"modules": false
|
||||
}]
|
||||
]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"presets": [
|
||||
["../../../../lib", {
|
||||
"configPath": "../fixtures/preset-options/browserslist-package",
|
||||
"configPath": "packages/babel-preset-env/test/fixtures/preset-options/browserslist-package",
|
||||
"targets": {
|
||||
"chrome": 55
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user