Skip to content

Commit 9c8da4a

Browse files
authored
test: use cft for e2e tests (#80)
we were using the Chrome version pre-installed on the GitHub actions and I wonder if it could have been the source for the flakiness.
1 parent 9204618 commit 9c8da4a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

tests/browser.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {describe, it} from 'node:test';
77
import assert from 'node:assert';
88
import os from 'node:os';
99
import path from 'node:path';
10+
import {executablePath} from 'puppeteer';
1011
import {launch} from '../src/browser.js';
1112

1213
describe('browser', () => {
@@ -17,13 +18,15 @@ describe('browser', () => {
1718
headless: true,
1819
isolated: false,
1920
userDataDir: folderPath,
21+
executablePath: executablePath(),
2022
});
2123
try {
2224
try {
2325
const browser2 = await launch({
2426
headless: true,
2527
isolated: false,
2628
userDataDir: folderPath,
29+
executablePath: executablePath(),
2730
});
2831
await browser2.close();
2932
assert.fail('not reached');

tests/index.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,19 @@ import {describe, it} from 'node:test';
99
import assert from 'node:assert';
1010
import fs from 'node:fs';
1111
import {ToolDefinition} from '../src/tools/ToolDefinition.js';
12+
import {executablePath} from 'puppeteer';
1213

1314
describe('e2e', () => {
1415
async function withClient(cb: (client: Client) => Promise<void>) {
1516
const transport = new StdioClientTransport({
1617
command: 'node',
17-
args: ['build/src/index.js', '--headless', '--isolated'],
18+
args: [
19+
'build/src/index.js',
20+
'--headless',
21+
'--isolated',
22+
'--executable-path',
23+
executablePath(),
24+
],
1825
});
1926
const client = new Client(
2027
{

0 commit comments

Comments
 (0)