Skip to content

Commit ecea538

Browse files
committed
test: fix missing sinon.restore
1 parent d469c98 commit ecea538

6 files changed

Lines changed: 26 additions & 6 deletions

File tree

tests/DevtoolsUtils.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import assert from 'node:assert';
8-
import {describe, it} from 'node:test';
8+
import {afterEach, describe, it} from 'node:test';
99

1010
import sinon from 'sinon';
1111

@@ -95,6 +95,10 @@ describe('urlsEqual', () => {
9595
});
9696

9797
describe('UniverseManager', () => {
98+
afterEach(() => {
99+
sinon.restore();
100+
});
101+
98102
it('calls the factory for existing pages', async () => {
99103
const browser = getMockBrowser();
100104
const factory = sinon.stub().resolves({});

tests/McpContext.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import assert from 'node:assert';
8-
import {describe, it} from 'node:test';
8+
import {afterEach, describe, it} from 'node:test';
99

1010
import sinon from 'sinon';
1111

@@ -16,6 +16,10 @@ import type {TraceResult} from '../src/trace-processing/parse.js';
1616
import {getMockRequest, html, withMcpContext} from './utils.js';
1717

1818
describe('McpContext', () => {
19+
afterEach(() => {
20+
sinon.restore();
21+
});
22+
1923
it('list pages', async () => {
2024
await withMcpContext(async (_response, context) => {
2125
const page = context.getSelectedPage();

tests/PageCollector.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import assert from 'node:assert';
8-
import {beforeEach, describe, it} from 'node:test';
8+
import {afterEach, beforeEach, describe, it} from 'node:test';
99

1010
import type {Frame, HTTPRequest, Target, Protocol} from 'puppeteer-core';
1111
import sinon from 'sinon';
@@ -302,6 +302,10 @@ describe('ConsoleCollector', () => {
302302
};
303303
});
304304

305+
afterEach(() => {
306+
sinon.restore();
307+
});
308+
305309
it('emits issues on page', async () => {
306310
const browser = getMockBrowser();
307311
const page = (await browser.pages())[0];

tests/formatters/IssueFormatter.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe('IssueFormatter', () => {
2121
});
2222

2323
afterEach(() => {
24-
getIssueDescriptionStub.restore();
24+
sinon.restore();
2525
});
2626

2727
it('formats an issue message', t => {

tests/tools/extensions.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import assert from 'node:assert';
88
import path from 'node:path';
9-
import {describe, it} from 'node:test';
9+
import {afterEach, describe, it} from 'node:test';
1010

1111
import sinon from 'sinon';
1212

@@ -34,6 +34,10 @@ function extractId(response: McpResponse) {
3434
}
3535

3636
describe('extension', () => {
37+
afterEach(() => {
38+
sinon.restore();
39+
});
40+
3741
it('installs and uninstalls an extension and verifies it in chrome://extensions', async () => {
3842
await withMcpContext(async (response, context) => {
3943
// Install the extension

tests/tools/pages.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import assert from 'node:assert';
8-
import {describe, it} from 'node:test';
8+
import {afterEach, describe, it} from 'node:test';
99

1010
import type {Dialog} from 'puppeteer-core';
1111
import sinon from 'sinon';
@@ -23,6 +23,10 @@ import {
2323
import {html, withMcpContext} from '../utils.js';
2424

2525
describe('pages', () => {
26+
afterEach(() => {
27+
sinon.restore();
28+
});
29+
2630
describe('list_pages', () => {
2731
it('list pages', async () => {
2832
await withMcpContext(async (response, context) => {

0 commit comments

Comments
 (0)