@testspectra/cli 1.1.10 → 1.1.11-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/.testspectra-runner.hash +1 -0
- package/dist/commands/__tests__/doctor-scope.test.js +24 -0
- package/dist/commands/__tests__/run.test.js +27 -0
- package/dist/commands/run.d.ts +3 -0
- package/dist/commands/run.js +10 -1
- package/dist/config/schema.d.ts +2 -2
- package/dist/generator/__tests__/type-generator.test.js +1 -1
- package/dist/index.js +3 -0
- package/package.json +7 -7
- package/templates/default/package.json +2 -2
- package/templates/nx/.nx/workspace-data/d/daemon.log +1012 -6493
- package/templates/nx/.nx/workspace-data/file-map.json +19 -19
- package/templates/nx/.nx/workspace-data/lockfile.hash +1 -1
- package/templates/nx/.nx/workspace-data/nx_files.nxt +0 -0
- package/templates/nx/.nx/workspace-data/parsed-lock-file.json +130 -81
- package/templates/nx/.nx/workspace-data/project-graph.json +138 -83
- package/templates/nx/package.json +2 -2
- package/templates/react-component/package.json +3 -3
- package/dist/.tsbuildinfo +0 -1
- package/dist/commands/update.d.ts +0 -3
- package/dist/commands/update.js +0 -109
- package/dist/lifecycle/__tests__/lifecycle-engine.test.js +0 -290
- package/dist/lifecycle/hook-discovery.d.ts +0 -24
- package/dist/lifecycle/hook-discovery.js +0 -60
- package/dist/lifecycle/hook-dispatcher.d.ts +0 -34
- package/dist/lifecycle/hook-dispatcher.js +0 -190
- package/dist/lifecycle/index.d.ts +0 -3
- package/dist/lifecycle/index.js +0 -3
- package/dist/lifecycle/parallel-grouping.d.ts +0 -27
- package/dist/lifecycle/parallel-grouping.js +0 -151
- package/templates/nx/.nx/workspace-data/70094CFD-E89B-57A1-9619-2FC5F4963C54.db-shm +0 -0
- package/templates/nx/.nx/workspace-data/70094CFD-E89B-57A1-9619-2FC5F4963C54.db-wal +0 -0
- package/templates/nx/.nx/workspace-data/d/server-process.json +0 -3
- /package/dist/{lifecycle/__tests__/lifecycle-engine.test.d.ts → commands/__tests__/doctor-scope.test.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2db95c618fc201b3c5e4b2f56e93c5e5fca36ba0d31250c65c98aabed5385361
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
+
const { execFileSyncMock } = vi.hoisted(() => ({ execFileSyncMock: vi.fn() }));
|
|
3
|
+
vi.mock('child_process', () => ({
|
|
4
|
+
execFileSync: execFileSyncMock,
|
|
5
|
+
spawn: vi.fn(),
|
|
6
|
+
}));
|
|
7
|
+
vi.mock('../../runner/bridge.js', () => ({
|
|
8
|
+
RustCoreBridge: { resolveBinaryPath: () => '/fake/testspectra-runner' },
|
|
9
|
+
}));
|
|
10
|
+
import { runSystemChecks } from '../doctor.js';
|
|
11
|
+
describe('runSystemChecks scope forwarding', () => {
|
|
12
|
+
it('forwards a category scope to the runner (efficient partial doctor)', async () => {
|
|
13
|
+
execFileSyncMock.mockReturnValueOnce(JSON.stringify({ all_ready: true, missing_count: 0, dependencies: [] }));
|
|
14
|
+
await runSystemChecks('/tmp/ws', 'web');
|
|
15
|
+
const [, args] = execFileSyncMock.mock.calls.at(-1);
|
|
16
|
+
expect(args).toEqual(['doctor', '--json', '--scope', 'web']);
|
|
17
|
+
});
|
|
18
|
+
it('omits --scope entirely when no scope is requested (full doctor)', async () => {
|
|
19
|
+
execFileSyncMock.mockReturnValueOnce(JSON.stringify({ all_ready: true, missing_count: 0, dependencies: [] }));
|
|
20
|
+
await runSystemChecks('/tmp/ws');
|
|
21
|
+
const [, args] = execFileSyncMock.mock.calls.at(-1);
|
|
22
|
+
expect(args).toEqual(['doctor', '--json']);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -270,4 +270,31 @@ describe('runCommand Integration & Dynamic Worker Sizing', () => {
|
|
|
270
270
|
expect(bridgeOptionsReceived).not.toBeNull();
|
|
271
271
|
expect(bridgeOptionsReceived.specs).toEqual(['specs/Auth/TC-0001/web.test.ts', 'specs/Auth/TC-0002/web.test.ts']);
|
|
272
272
|
});
|
|
273
|
+
it('skips dev server auto-starting when devServer is false or skipDevServers is true', async () => {
|
|
274
|
+
vi.spyOn(TypeGenerator, 'writeDeclarationFiles').mockImplementation(() => { });
|
|
275
|
+
vi.spyOn(TypeGenerator, 'syncEnvDeclaration').mockResolvedValue(undefined);
|
|
276
|
+
vi.spyOn(ConfigLoader, 'loadConfig').mockResolvedValue({
|
|
277
|
+
webConfig: {
|
|
278
|
+
baseUrl: 'http://localhost:3000',
|
|
279
|
+
devServers: [{ name: 'sso', command: 'pnpm dev', url: 'http://localhost:5174' }],
|
|
280
|
+
},
|
|
281
|
+
androidConfig: {},
|
|
282
|
+
iosConfig: {},
|
|
283
|
+
executionConfig: {},
|
|
284
|
+
});
|
|
285
|
+
vi.spyOn(RustCoreBridge, 'run').mockResolvedValue({
|
|
286
|
+
status: 'passed',
|
|
287
|
+
duration: '1.0s',
|
|
288
|
+
results: [],
|
|
289
|
+
logs: [],
|
|
290
|
+
});
|
|
291
|
+
const devServerSpy = vi.spyOn((await import('../../utils/dev-server-manager.js')).DevServerManager.prototype, 'startAll');
|
|
292
|
+
// With devServer: false, startAll must NOT be called
|
|
293
|
+
await runCommand(['specs/Auth/TC-0001/web.test.ts'], { devServer: false });
|
|
294
|
+
expect(devServerSpy).not.toHaveBeenCalled();
|
|
295
|
+
// With skipDevServers: true, startAll must NOT be called
|
|
296
|
+
devServerSpy.mockClear();
|
|
297
|
+
await runCommand(['specs/Auth/TC-0001/web.test.ts'], { skipDevServers: true });
|
|
298
|
+
expect(devServerSpy).not.toHaveBeenCalled();
|
|
299
|
+
});
|
|
273
300
|
});
|
package/dist/commands/run.d.ts
CHANGED
|
@@ -17,6 +17,9 @@ export interface RunCommandOptions {
|
|
|
17
17
|
failed?: boolean | string;
|
|
18
18
|
concurrency?: string | number;
|
|
19
19
|
licenseKey?: string;
|
|
20
|
+
devServer?: boolean;
|
|
21
|
+
devServers?: boolean;
|
|
22
|
+
skipDevServers?: boolean;
|
|
20
23
|
}
|
|
21
24
|
export declare function renderTimingBreakdown(performance: {
|
|
22
25
|
masterBootLatencyMs?: number;
|
package/dist/commands/run.js
CHANGED
|
@@ -178,7 +178,16 @@ export async function runCommand(specPaths, options = {}) {
|
|
|
178
178
|
...(config.webConfig.devServers || []),
|
|
179
179
|
...(config.webConfig.devServer ? [config.webConfig.devServer] : []),
|
|
180
180
|
];
|
|
181
|
-
|
|
181
|
+
const shouldStartDevServers = options.devServer !== false &&
|
|
182
|
+
options.devServers !== false &&
|
|
183
|
+
!options.skipDevServers &&
|
|
184
|
+
process.env.SPECTRA_SKIP_DEV_SERVERS !== '1' &&
|
|
185
|
+
process.env.SPECTRA_SKIP_DEV_SERVERS !== 'true' &&
|
|
186
|
+
process.env.SPECTRA_SKIP_DEV_SERVER !== '1' &&
|
|
187
|
+
process.env.SPECTRA_SKIP_DEV_SERVER !== 'true' &&
|
|
188
|
+
process.env.TESTSPECTRA_SKIP_DEV_SERVERS !== '1' &&
|
|
189
|
+
process.env.TESTSPECTRA_SKIP_DEV_SERVERS !== 'true';
|
|
190
|
+
if (shouldStartDevServers && configuredDevServers.length > 0 && !options.demo) {
|
|
182
191
|
await devServerManager.startAll(configuredDevServers, options.host, cwd);
|
|
183
192
|
}
|
|
184
193
|
if (options.demo) {
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface DevServerConfig {
|
|
|
11
11
|
*/
|
|
12
12
|
command: string;
|
|
13
13
|
/**
|
|
14
|
-
* Target URL or healthcheck endpoint (e.g. "https://sso.
|
|
14
|
+
* Target URL or healthcheck endpoint (e.g. "https://sso.example.local:5174").
|
|
15
15
|
*/
|
|
16
16
|
url: string;
|
|
17
17
|
/**
|
|
@@ -48,7 +48,7 @@ export interface WebConfig {
|
|
|
48
48
|
baseUrl: string;
|
|
49
49
|
/**
|
|
50
50
|
* Multi-host / multi-app mapping dictionary for micro-frontends and multi-entrypoint monorepos.
|
|
51
|
-
* Maps named aliases to full base URLs (e.g. `{ sso: "https://sso.
|
|
51
|
+
* Maps named aliases to full base URLs (e.g. `{ sso: "https://sso.example.local:5174", fam: "https://fam.example.local:5175" }`).
|
|
52
52
|
* Allows tests to navigate using `Spectra.navigate('sso:/login')` or CLI `--host sso`.
|
|
53
53
|
*/
|
|
54
54
|
hosts?: Record<string, string>;
|
|
@@ -393,7 +393,7 @@ async function verifyZeroImport() {
|
|
|
393
393
|
const featureLibDir = path.join(tmpDir, 'packages', 'features', 'auth');
|
|
394
394
|
fs.mkdirSync(featureLibDir, { recursive: true });
|
|
395
395
|
fs.writeFileSync(path.join(featureLibDir, 'project.json'), JSON.stringify({
|
|
396
|
-
name: '@
|
|
396
|
+
name: '@example/feature-auth',
|
|
397
397
|
projectType: 'library',
|
|
398
398
|
sourceRoot: 'packages/features/auth',
|
|
399
399
|
targets: {},
|
package/dist/index.js
CHANGED
|
@@ -182,6 +182,9 @@ Examples:
|
|
|
182
182
|
.option('--headless', 'Run in headless mode')
|
|
183
183
|
.option('--no-headless', 'Run in headed mode')
|
|
184
184
|
.option('--headed', 'Run browser in visible GUI mode (alias for --no-headless)')
|
|
185
|
+
.option('--no-dev-server', 'Skip auto-starting local development servers')
|
|
186
|
+
.option('--no-dev-servers', 'Skip auto-starting local development servers (alias)')
|
|
187
|
+
.option('--skip-dev-servers', 'Skip auto-starting local development servers')
|
|
185
188
|
.option('--step-delay <ms>', 'Delay between consecutive actions and commands in milliseconds (slow motion)')
|
|
186
189
|
.option('--delay <ms>', 'Alias for --step-delay')
|
|
187
190
|
.option('--failed [targets]', 'Re-run failed tests from previous run (accepts comma-separated test IDs or spec paths)')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testspectra/cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.11-rc.5",
|
|
4
4
|
"description": "TestSpectra Cross-Platform Test Runner CLI",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@clack/prompts": "^1.7.0",
|
|
29
|
-
"@testspectra/matchers": "^1.1.
|
|
30
|
-
"@testspectra/react": "^1.1.
|
|
31
|
-
"@testspectra/skills": "^1.1.
|
|
29
|
+
"@testspectra/matchers": "^1.1.11-rc.5",
|
|
30
|
+
"@testspectra/react": "^1.1.11-rc.5",
|
|
31
|
+
"@testspectra/skills": "^1.1.11-rc.5",
|
|
32
32
|
"chalk": "^5.3.0",
|
|
33
33
|
"commander": "^12.1.0",
|
|
34
34
|
"cross-spawn": "^7.0.6",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"zod": "^3.23.8"
|
|
40
40
|
},
|
|
41
41
|
"optionalDependencies": {
|
|
42
|
-
"@testspectra/cli-darwin-arm64": "1.1.
|
|
43
|
-
"@testspectra/cli-linux-x64": "1.1.
|
|
44
|
-
"@testspectra/cli-win32-x64": "1.1.
|
|
42
|
+
"@testspectra/cli-darwin-arm64": "1.1.11-rc.5",
|
|
43
|
+
"@testspectra/cli-linux-x64": "1.1.11-rc.5",
|
|
44
|
+
"@testspectra/cli-win32-x64": "1.1.11-rc.5"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/cross-spawn": "^6.0.6",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"postinstall": "spectra sync-types"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@testspectra/cli": "^1.1.
|
|
21
|
-
"@testspectra/matchers": "^1.1.
|
|
20
|
+
"@testspectra/cli": "^1.1.11-rc.5",
|
|
21
|
+
"@testspectra/matchers": "^1.1.11-rc.5",
|
|
22
22
|
"@types/node": "^20.14.0",
|
|
23
23
|
"@wdio/cli": "^9.2.8",
|
|
24
24
|
"@wdio/local-runner": "^9.2.8",
|