Skip to content

Commit 7a219bc

Browse files
committed
style(test): format artifact run id guard
1 parent be4ecd9 commit 7a219bc

2 files changed

Lines changed: 9 additions & 14 deletions

File tree

src/commands/test.artifact.spec.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -355,17 +355,14 @@ describe('runArtifactGet', () => {
355355
'nested/run',
356356
'nested\\run',
357357
'bad\0id',
358-
])(
359-
'rejects unsafe default artifact runId segment %j',
360-
runId => {
361-
expect(() => resolveDefaultArtifactDir(runId, '/repo')).toThrowError(
362-
expect.objectContaining({
363-
code: 'VALIDATION_ERROR',
364-
details: expect.objectContaining({ field: 'run-id' }),
365-
}),
366-
);
367-
},
368-
);
358+
])('rejects unsafe default artifact runId segment %j', runId => {
359+
expect(() => resolveDefaultArtifactDir(runId, '/repo')).toThrowError(
360+
expect.objectContaining({
361+
code: 'VALIDATION_ERROR',
362+
details: expect.objectContaining({ field: 'run-id' }),
363+
}),
364+
);
365+
});
369366

370367
it('keeps the documented default directory for path-safe runIds', () => {
371368
expect(resolveDefaultArtifactDir(SAMPLE_RUN_ID, '/repo')).toBe(

src/commands/test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6842,9 +6842,7 @@ export async function runArtifactGet(
68426842

68436843
// Resolve output dir: explicit --out or the default .testsprite/runs/<runId>/
68446844
const resolvedDir =
6845-
opts.out !== undefined
6846-
? resolveBundleDir(opts.out)
6847-
: resolveDefaultArtifactDir(runId);
6845+
opts.out !== undefined ? resolveBundleDir(opts.out) : resolveDefaultArtifactDir(runId);
68486846

68496847
// --dry-run: no network, no disk write.
68506848
// The client (makeClient) is already wired with createDryRunFetch() when

0 commit comments

Comments
 (0)