Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tests/DevtoolsUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import assert from 'node:assert';
import {describe, it} from 'node:test';
import {afterEach, describe, it} from 'node:test';

import sinon from 'sinon';

Expand Down Expand Up @@ -95,6 +95,10 @@ describe('urlsEqual', () => {
});

describe('UniverseManager', () => {
afterEach(() => {
sinon.restore();
});

it('calls the factory for existing pages', async () => {
const browser = getMockBrowser();
const factory = sinon.stub().resolves({});
Expand Down
6 changes: 5 additions & 1 deletion tests/McpContext.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import assert from 'node:assert';
import {describe, it} from 'node:test';
import {afterEach, describe, it} from 'node:test';

import sinon from 'sinon';

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

describe('McpContext', () => {
afterEach(() => {
sinon.restore();
});

it('list pages', async () => {
await withMcpContext(async (_response, context) => {
const page = context.getSelectedPage();
Expand Down
6 changes: 5 additions & 1 deletion tests/PageCollector.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import assert from 'node:assert';
import {beforeEach, describe, it} from 'node:test';
import {afterEach, beforeEach, describe, it} from 'node:test';

import type {Frame, HTTPRequest, Target, Protocol} from 'puppeteer-core';
import sinon from 'sinon';
Expand Down Expand Up @@ -302,6 +302,10 @@ describe('ConsoleCollector', () => {
};
});

afterEach(() => {
Comment thread
OrKoN marked this conversation as resolved.
sinon.restore();
});

it('emits issues on page', async () => {
const browser = getMockBrowser();
const page = (await browser.pages())[0];
Expand Down
2 changes: 1 addition & 1 deletion tests/formatters/IssueFormatter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('IssueFormatter', () => {
});

afterEach(() => {
getIssueDescriptionStub.restore();
sinon.restore();
});

it('formats an issue message', t => {
Expand Down
6 changes: 5 additions & 1 deletion tests/tools/extensions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import assert from 'node:assert';
import path from 'node:path';
import {describe, it} from 'node:test';
import {afterEach, describe, it} from 'node:test';

import sinon from 'sinon';

Expand Down Expand Up @@ -34,6 +34,10 @@ function extractId(response: McpResponse) {
}

describe('extension', () => {
afterEach(() => {
sinon.restore();
});

it('installs and uninstalls an extension and verifies it in chrome://extensions', async () => {
await withMcpContext(async (response, context) => {
// Install the extension
Expand Down
6 changes: 5 additions & 1 deletion tests/tools/pages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import assert from 'node:assert';
import {describe, it} from 'node:test';
import {afterEach, describe, it} from 'node:test';

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

describe('pages', () => {
afterEach(() => {
sinon.restore();
});

describe('list_pages', () => {
it('list pages', async () => {
await withMcpContext(async (response, context) => {
Expand Down