Skip to content

Commit 65c2267

Browse files
authored
Upgrade: sinon (#11855)
1 parent cd611a5 commit 65c2267

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

test.js

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,8 @@ const formatter = proxyquire("../../../../lib/cli-engine/formatters/codeframe",
4242
//------------------------------------------------------------------------------
4343

4444
describe("formatter:codeframe", () => {
45-
let sandbox;
46-
47-
beforeEach(() => {
48-
sandbox = sinon.sandbox.create();
49-
});
50-
5145
afterEach(() => {
52-
sandbox.verifyAndRestore();
46+
sinon.verifyAndRestore();
5347
});
5448

5549
describe("when passed no messages", () => {
@@ -99,8 +93,8 @@ describe("formatter:codeframe", () => {
9993
});
10094

10195
it("should return bold yellow summary when there are only warnings", () => {
102-
sandbox.spy(chalkStub.yellow, "bold");
103-
sandbox.spy(chalkStub.red, "bold");
96+
sinon.spy(chalkStub.yellow, "bold");
97+
sinon.spy(chalkStub.red, "bold");
10498

10599
formatter(code);
106100

@@ -160,8 +154,8 @@ describe("formatter:codeframe", () => {
160154
});
161155

162156
it("should return bold red summary when there are errors", () => {
163-
sandbox.spy(chalkStub.yellow, "bold");
164-
sandbox.spy(chalkStub.red, "bold");
157+
sinon.spy(chalkStub.yellow, "bold");
158+
sinon.spy(chalkStub.red, "bold");
165159

166160
formatter(code);
167161

@@ -230,8 +224,8 @@ describe("formatter:codeframe", () => {
230224
});
231225

232226
it("should return bold red summary when at least 1 of the messages is an error", () => {
233-
sandbox.spy(chalkStub.yellow, "bold");
234-
sandbox.spy(chalkStub.red, "bold");
227+
sinon.spy(chalkStub.yellow, "bold");
228+
sinon.spy(chalkStub.red, "bold");
235229
code[0].messages[0].severity = 1;
236230
code[0].warningCount = 1;
237231
code[0].errorCount = 1;

0 commit comments

Comments
 (0)