Skip to content

Commit 63f6582

Browse files
committed
🔧 Use absolute path to launcher script, simplify CI to Node 22 only
- Use import.meta.url to resolve launcher path (works with local file: deps) - Remove npx dependency which tried to fetch from npm - Simplify CI to test only Node 22 (Playwright API is stable across versions)
1 parent 9cac05d commit 63f6582

File tree

3 files changed

+31
-29
lines changed

3 files changed

+31
-29
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -503,17 +503,13 @@ jobs:
503503
needs: [lint, changes-ember]
504504
if: needs.changes-ember.outputs.ember == 'true'
505505

506-
strategy:
507-
matrix:
508-
node-version: [22, 24]
509-
510506
steps:
511507
- uses: actions/checkout@v4
512508

513-
- name: Use Node.js ${{ matrix.node-version }}
509+
- name: Use Node.js 22
514510
uses: actions/setup-node@v4
515511
with:
516-
node-version: ${{ matrix.node-version }}
512+
node-version: 22
517513

518514
- name: Install CLI dependencies
519515
run: npm ci
@@ -559,7 +555,6 @@ jobs:
559555
CI: true
560556

561557
- name: Run Ember E2E visual tests
562-
if: matrix.node-version == 22
563558
working-directory: ./clients/ember
564559
run: |
565560
cd test-app

clients/ember/src/testem-config.js

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
*/
99

1010
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
11-
import { join } from 'node:path';
11+
import { dirname, join } from 'node:path';
12+
import { fileURLToPath } from 'node:url';
1213

1314
/**
1415
* Browser name mappings from user-friendly names to Vizzly launchers
@@ -43,26 +44,38 @@ function remapBrowsers(browsers) {
4344
return browsers.map(browser => browserMappings[browser] || browser);
4445
}
4546

47+
/**
48+
* Get the path to the launcher script
49+
* @returns {string} Absolute path to vizzly-testem-launcher.js
50+
*/
51+
function getLauncherPath() {
52+
// This file is at src/testem-config.js, launcher is at bin/vizzly-testem-launcher.js
53+
let currentDir = dirname(fileURLToPath(import.meta.url));
54+
return join(currentDir, '..', 'bin', 'vizzly-testem-launcher.js');
55+
}
56+
4657
/**
4758
* Create launcher definitions for Vizzly browsers
4859
* Testem automatically appends the test URL to the args array
4960
* @returns {Object} Launcher configuration object
5061
*/
5162
function createLaunchers() {
63+
let launcherPath = getLauncherPath();
64+
5265
return {
5366
VizzlyChrome: {
54-
exe: 'npx',
55-
args: ['vizzly-testem-launcher', 'chromium'],
67+
exe: 'node',
68+
args: [launcherPath, 'chromium'],
5669
protocol: 'browser',
5770
},
5871
VizzlyFirefox: {
59-
exe: 'npx',
60-
args: ['vizzly-testem-launcher', 'firefox'],
72+
exe: 'node',
73+
args: [launcherPath, 'firefox'],
6174
protocol: 'browser',
6275
},
6376
VizzlyWebKit: {
64-
exe: 'npx',
65-
args: ['vizzly-testem-launcher', 'webkit'],
77+
exe: 'node',
78+
args: [launcherPath, 'webkit'],
6679
protocol: 'browser',
6780
},
6881
};

clients/ember/tests/unit/testem-config.test.js

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,35 +105,29 @@ describe('testem-config', () => {
105105
let result = configure({});
106106
let launcher = result.launchers.VizzlyChrome;
107107

108-
assert.strictEqual(launcher.exe, 'npx');
109-
assert.deepStrictEqual(launcher.args, [
110-
'vizzly-testem-launcher',
111-
'chromium',
112-
]);
108+
assert.strictEqual(launcher.exe, 'node');
109+
assert.ok(launcher.args[0].endsWith('vizzly-testem-launcher.js'));
110+
assert.strictEqual(launcher.args[1], 'chromium');
113111
assert.strictEqual(launcher.protocol, 'browser');
114112
});
115113

116114
it('creates correct VizzlyFirefox launcher config', () => {
117115
let result = configure({});
118116
let launcher = result.launchers.VizzlyFirefox;
119117

120-
assert.strictEqual(launcher.exe, 'npx');
121-
assert.deepStrictEqual(launcher.args, [
122-
'vizzly-testem-launcher',
123-
'firefox',
124-
]);
118+
assert.strictEqual(launcher.exe, 'node');
119+
assert.ok(launcher.args[0].endsWith('vizzly-testem-launcher.js'));
120+
assert.strictEqual(launcher.args[1], 'firefox');
125121
assert.strictEqual(launcher.protocol, 'browser');
126122
});
127123

128124
it('creates correct VizzlyWebKit launcher config', () => {
129125
let result = configure({});
130126
let launcher = result.launchers.VizzlyWebKit;
131127

132-
assert.strictEqual(launcher.exe, 'npx');
133-
assert.deepStrictEqual(launcher.args, [
134-
'vizzly-testem-launcher',
135-
'webkit',
136-
]);
128+
assert.strictEqual(launcher.exe, 'node');
129+
assert.ok(launcher.args[0].endsWith('vizzly-testem-launcher.js'));
130+
assert.strictEqual(launcher.args[1], 'webkit');
137131
assert.strictEqual(launcher.protocol, 'browser');
138132
});
139133

0 commit comments

Comments
 (0)