Skip to content

Commit 04dc6ac

Browse files
committed
More mock-fs restore inline
1 parent 4782a78 commit 04dc6ac

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

lib/importer/src/config.test.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ mock_files({
1111

1212
describe("Configuration tests", () => {
1313

14-
// Restore the original fs after tests so that we
15-
// don't break any other use of the fs module.
16-
afterEach(() => { mock_files.restore(); })
17-
1814
test('initial empty config', () => {
1915
mock_files({
2016
'./empty/app/config.json': '{}'
@@ -39,6 +35,8 @@ describe("Configuration tests", () => {
3935
expect(c.uploadPath).not.toBeNull()
4036
}
4137
);
38+
39+
mock_files.restore();
4240
});
4341

4442
test('existing fields', () => {
@@ -58,6 +56,8 @@ describe("Configuration tests", () => {
5856
expect(c.fields).toStrictEqual(["A", "B"])
5957
}
6058
);
59+
60+
mock_files.restore();
6161
});
6262

6363
test('existing path', () => {
@@ -77,6 +77,8 @@ describe("Configuration tests", () => {
7777
expect(c.uploadPath).toBe("/opt")
7878
}
7979
);
80+
81+
mock_files.restore();
8082
});
8183

8284
})

prototypes/basic/package-lock.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)