Skip to content

Commit f369145

Browse files
committed
Revert "Fix broken unit tests caused by stubbed process.version"
This reverts commit f339591.
1 parent 6e2cff0 commit f369145

1 file changed

Lines changed: 8 additions & 13 deletions

File tree

tests/lib/cli-engine/lint-result-cache.js

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -163,21 +163,16 @@ describe("LintResultCache", () => {
163163
it("contains node version during hashing", () => {
164164
const version = "node-=-version";
165165

166-
const versionStub = sandbox.stub(process, "version").value(version);
167-
168-
try {
169-
const NewLintResultCache = proxyquire("../../../lib/cli-engine/lint-result-cache.js", {
170-
"./hash": hashStub
171-
});
172-
const newLintResultCache = new NewLintResultCache(cacheFileLocation, "metadata");
166+
sandbox.stub(process, "version").value(version);
167+
const NewLintResultCache = proxyquire("../../../lib/cli-engine/lint-result-cache.js", {
168+
"./hash": hashStub
169+
});
170+
const newLintResultCache = new NewLintResultCache(cacheFileLocation, "metadata");
173171

174-
newLintResultCache.getCachedLintResults(filePath, fakeConfig);
172+
newLintResultCache.getCachedLintResults(filePath, fakeConfig);
175173

176-
assert.ok(hashStub.calledOnce);
177-
assert.ok(hashStub.calledWithMatch(version));
178-
} finally {
179-
versionStub.restore();
180-
}
174+
assert.ok(hashStub.calledOnce);
175+
assert.ok(hashStub.calledWithMatch(version));
181176
});
182177
});
183178

0 commit comments

Comments
 (0)