Skip to content

Commit 854f6f3

Browse files
committed
Ensure tests run in the project folder.
1 parent 1094955 commit 854f6f3

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

apps/zipsync/src/cli/test/__snapshots__/start.test.ts.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ zipsync {version} - https://rushstack.io
66
77
usage: zipsync [-h] [-d] [-v] -m {pack,unpack} -a ARCHIVE_PATH -t
88
TARGET_DIRECTORIES -b BASE_DIR -z {store,deflate,zstd,auto}
9-
9+
1010
1111
Optional arguments:
1212
-h, --help Show this help message and exit.
13-
-d, --debug Show the full call stack if an error occurs while
13+
-d, --debug Show the full call stack if an error occurs while
1414
executing the tool
1515
-v, --verbose Show verbose output
1616
-m {pack,unpack}, --mode {pack,unpack}
@@ -23,10 +23,10 @@ Optional arguments:
2323
-b BASE_DIR, --base-dir BASE_DIR
2424
Base directory for relative paths within the archive
2525
-z {store,deflate,zstd,auto}, --compression {store,deflate,zstd,auto}
26-
Compression strategy when packing. \\"deflate\\" and
27-
\\"zlib\\" attempts compression for every file (keeps
28-
only if smaller); \\"auto\\" first skips
29-
likely-compressed types before attempting \\"deflate\\"
26+
Compression strategy when packing. \\"deflate\\" and
27+
\\"zlib\\" attempts compression for every file (keeps
28+
only if smaller); \\"auto\\" first skips
29+
likely-compressed types before attempting \\"deflate\\"
3030
compression; \\"store\\" disables compression.
3131
3232
For detailed help about a specific command, use: zipsync <command> -h

apps/zipsync/src/cli/test/start.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
22
// See LICENSE in the project root for license information.
33

4+
import path from 'node:path';
45
import { execSync } from 'node:child_process';
56

67
describe('CLI Tool Tests', () => {
78
it('should display help for "zipsync --help"', () => {
8-
const startOutput = execSync('node lib/start.js --help', { encoding: 'utf-8' });
9+
const packageFolder: string = path.resolve(__dirname, '../../..');
10+
const startOutput = execSync('node lib/start.js --help', { encoding: 'utf-8', cwd: packageFolder });
911
const normalized = startOutput.replace(
1012
/zipsync \d+\.\d+\.\d+(?:-[0-9A-Za-z-.]+)? - https:\/\/rushstack\.io/,
1113
'zipsync {version} - https://rushstack.io'

0 commit comments

Comments
 (0)