Skip to content

Commit dbea002

Browse files
committed
test: gate the macOS URL-scheme-handler dispatcher-seam test to macOS since it drives the ObjC runtime
1 parent 91e091f commit dbea002

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

tests/unit/main/platform/macos/cocoa-url-scheme-handler.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { afterEach, describe, expect, test } from 'bun:test';
2+
import { currentPlatform } from '../../../../../src/common/platform';
23
import {
34
createUrlSchemeHandler,
45
handleStartTask,
@@ -32,15 +33,18 @@ describe('cocoa-url-scheme-handler exports', () => {
3233
});
3334
});
3435

35-
describe('dispatcher injection seam', () => {
36+
// macOS-only: handleStartTask drives the ObjC runtime (to read the task's URL),
37+
// which is unavailable off macOS — on Linux it bails to the decline path without
38+
// reaching the dispatcher, so this seam test must run on macOS only.
39+
describe.skipIf(currentPlatform() !== 'macos')('dispatcher injection seam', () => {
3640
test('a substituted dispatcher receiving a null task url declines without throwing', () => {
3741
let seen: string | undefined;
3842
setUrlSchemeDispatcherForTesting((url) => {
3943
seen = url;
4044
return undefined;
4145
});
42-
// task = 0n means requestUrlOf returns '' without touching real ObjC; the
43-
// decline path (failTask) is best-effort and swallows on a null task.
46+
// task = 0n: on macOS requestUrlOf returns '' (the dispatcher is still called
47+
// with the empty url); the decline path (failTask) is best-effort.
4448
expect(() => handleStartTask(0n)).not.toThrow();
4549
expect(seen).toBe('');
4650
});

0 commit comments

Comments
 (0)