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
2 changes: 1 addition & 1 deletion .github/workflows/tests_primary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.3
bun-version: latest
- uses: ./.github/actions/run-test
with:
command: npm run ttest
Expand Down
6 changes: 5 additions & 1 deletion packages/playwright/src/transform/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ export function wrapFunctionWithLocation<A extends any[], R>(func: (location: Lo
return (...args) => {
const oldPrepareStackTrace = Error.prepareStackTrace;
const oldStackTraceLimit = Error.stackTraceLimit;
Error.prepareStackTrace = 'Bun' in globalThis ? bunCallerLocation : nodeCallerLocation;
Error.prepareStackTrace = bunHasZeroBasedColumns ? bunCallerLocation : nodeCallerLocation;
Error.stackTraceLimit = 2;
const obj: { stack: Location } = {} as any;
let location: Location;
Expand All @@ -412,6 +412,10 @@ function nodeCallerLocation(error: Error, stackFrames: NodeJS.CallSite[]) {
};
}

declare const Bun: { version: string, semver: { order(a: string, b: string): number } };
// Bun's CallSite columns were 0-based before 1.4.4; since then they match V8.
const bunHasZeroBasedColumns = 'Bun' in globalThis && Bun.semver.order(Bun.version, '1.4.4') < 0;

function bunCallerLocation(error: Error, stackFrames: NodeJS.CallSite[]) {
const frame = stackFrames[1];
// Bun's CallSite.getColumnNumber() is 0-based, and Bun does not apply source maps of .js files.
Expand Down
4 changes: 3 additions & 1 deletion tests/playwright-test/list-mode.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ import { test, expect } from './playwright-test-fixtures';
import path from 'path';
import fs from 'fs';

test('should list tests', async ({ runInlineTest }) => {
test('should list tests', {
annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/43934' },
}, async ({ runInlineTest }) => {
const result = await runInlineTest({
'playwright.config.ts': `
export default { projects: [{ name: 'foo' }, {}] };
Expand Down
Loading