Skip to content

Commit

Permalink
fix: correct tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chambo-e committed Feb 16, 2021
1 parent addd798 commit 61a1967
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/lib/cli-engine/lint-result-cache.js
Expand Up @@ -80,7 +80,7 @@ describe("LintResultCache", () => {
});

afterEach(done => {
sinon.reset();
sandbox.reset();

fs.unlink(cacheFileLocation, err => {
if (err && err.code !== "ENOENT") {
Expand Down Expand Up @@ -131,7 +131,7 @@ describe("LintResultCache", () => {
let cacheEntry, getFileDescriptorStub, lintResultsCache;

before(() => {
getFileDescriptorStub = sinon.stub();
getFileDescriptorStub = sandbox.stub();

fileEntryCacheStubs.create = () => ({
getFileDescriptor: getFileDescriptorStub
Expand Down Expand Up @@ -177,13 +177,14 @@ describe("LintResultCache", () => {
it("contains node version during hashing", () => {
const version = "node-=-version";

sinon.stub(process, "version").value(version);
sandbox.stub(process, "version").value(version);
const NewLintResultCache = proxyquire("../../../lib/cli-engine/lint-result-cache.js", {
"./hash": hashStub
});
const newLintResultCache = new NewLintResultCache(cacheFileLocation, fakeConfigHelper);

newLintResultCache.getCachedLintResults(filePath, fakeConfig);

assert.ok(hashStub.calledOnce);
assert.ok(hashStub.calledWithMatch(version));
});
Expand Down Expand Up @@ -266,7 +267,7 @@ describe("LintResultCache", () => {
let cacheEntry, getFileDescriptorStub, lintResultsCache;

before(() => {
getFileDescriptorStub = sinon.stub();
getFileDescriptorStub = sandbox.stub();

fileEntryCacheStubs.create = () => ({
getFileDescriptor: getFileDescriptorStub
Expand Down Expand Up @@ -370,7 +371,7 @@ describe("LintResultCache", () => {
let reconcileStub, lintResultsCache;

before(() => {
reconcileStub = sinon.stub();
reconcileStub = sandbox.stub();

fileEntryCacheStubs.create = () => ({
reconcile: reconcileStub
Expand Down

0 comments on commit 61a1967

Please sign in to comment.