Skip to content

Commit ac7e9df

Browse files
committed
test: remove redundant test cases
1 parent 0833105 commit ac7e9df

14 files changed

Lines changed: 5 additions & 525 deletions

packages/rstack/src/fmt/cli.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,5 +366,4 @@ const runFmtCLI = async (args: string[]): Promise<void> => {
366366
}
367367
};
368368

369-
export { fmtHelpMessage, parseFmtCLIArgs, prettyTime, runFmtCLI };
370-
export type { ParsedFmtCLIArgs };
369+
export { runFmtCLI };

packages/rstack/src/fmt/workerPool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@ const createFmtWorkerPool = async (
6464
};
6565
};
6666

67-
export { createFmtWorkerPool, getFmtWorkerCount };
67+
export { createFmtWorkerPool };
6868
export type { FmtWorkerPool };

packages/rstack/src/projectCache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ const ensureProjectCacheDir = async (rootPath: string): Promise<ProjectCacheResu
3131
}
3232
};
3333

34-
export { ensureProjectCacheDir, getProjectCacheDir };
34+
export { ensureProjectCacheDir };
3535
export type { ProjectCacheResult };

packages/rstack/tests/fmt/__snapshots__/cli.test.ts.snap

Lines changed: 0 additions & 22 deletions
This file was deleted.

packages/rstack/tests/fmt/cli.test.ts

Lines changed: 0 additions & 212 deletions
This file was deleted.

packages/rstack/tests/fmt/format.test.ts

Lines changed: 0 additions & 62 deletions
This file was deleted.

packages/rstack/tests/fmt/pathHelpers.test.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

packages/rstack/tests/fmt/runnerWorkerPreflight.test.ts

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { readFileSync } from 'node:fs';
21
import path from 'node:path';
32
import { beforeEach, expect, rs, test } from 'rstack/test';
43
import { cacheNamespace, createOptionsHasher } from '../../src/fmt/cacheIdentity.ts';
@@ -22,39 +21,6 @@ beforeEach(() => {
2221
mocks.createFmtWorkerPoolCalls.length = 0;
2322
});
2423

25-
const createRequest = (filePath: string): FmtFileRequest => ({
26-
path: filePath,
27-
options: {
28-
parser: 'typescript',
29-
},
30-
});
31-
32-
test('starts the worker pool before formatting a single file', async () => {
33-
await withTempProject(async (rootPath) => {
34-
const filePath = writeProjectFile(rootPath, 'index.ts', 'const value=1');
35-
36-
await expect(
37-
runFmtFiles({
38-
files: [createRequest(filePath)],
39-
mode: 'write',
40-
maxWorkers: 1,
41-
}),
42-
).rejects.toThrow('worker startup failed');
43-
44-
expect(mocks.createFmtWorkerPoolCalls).toEqual([[1, 1]]);
45-
expect(readFileSync(filePath, 'utf8')).toBe('const value=1');
46-
});
47-
});
48-
49-
test('does not start the worker pool when there are no files', async () => {
50-
await expect(runFmtFiles({ files: [], mode: 'write' })).resolves.toMatchObject({
51-
files: [],
52-
exitCode: 0,
53-
processedFileCount: 0,
54-
});
55-
expect(mocks.createFmtWorkerPoolCalls).toEqual([]);
56-
});
57-
5824
test('does not start the worker pool when every parser result is cached as unsupported', async () => {
5925
await withTempProject(async (rootPath) => {
6026
const filePath = writeProjectFile(rootPath, 'example.unknown', 'plain text');

0 commit comments

Comments
 (0)