Skip to content

Commit ea128d5

Browse files
committed
test: fix autofixes from vitest/prefer-strict-boolean-matchers
1 parent 5d7f7ea commit ea128d5

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

e2e/ci-e2e/tests/basic.e2e.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe('CI - standalone mode', () => {
6060
path.join(repo.baseDir, '.code-pushup/.ci/.current/report.json'),
6161
'utf8',
6262
);
63-
await expect(jsonPromise).resolves.toBe(true);
63+
await expect(jsonPromise).resolves.not.toThrow();
6464
const report = JSON.parse(await jsonPromise) as Report;
6565
expect(report).toEqual(
6666
expect.objectContaining({
@@ -137,7 +137,7 @@ describe('CI - standalone mode', () => {
137137
path.join(repo.baseDir, '.code-pushup/.ci/.comparison/report-diff.md'),
138138
'utf8',
139139
);
140-
await expect(mdPromise).resolves.toBe(true);
140+
await expect(mdPromise).resolves.not.toThrow();
141141
const md = await mdPromise;
142142
await expect(
143143
md.replace(/[\da-f]{40}/g, '`<commit-sha>`'),

e2e/ci-e2e/tests/npm-workspaces.e2e.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ describe('CI - monorepo mode (npm workspaces)', () => {
175175
path.join(repo.baseDir, '.code-pushup/.ci/.comparison/report-diff.md'),
176176
'utf8',
177177
);
178-
await expect(mdPromise).resolves.toBe(true);
178+
await expect(mdPromise).resolves.not.toThrow();
179179
const md = await mdPromise;
180180
await expect(
181181
md.replace(/[\da-f]{40}/g, '`<commit-sha>`'),

e2e/ci-e2e/tests/nx-monorepo.e2e.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ describe('CI - monorepo mode (Nx)', () => {
208208
path.join(repo.baseDir, '.code-pushup/.ci/.comparison/report-diff.md'),
209209
'utf8',
210210
);
211-
await expect(mdPromise).resolves.toBe(true);
211+
await expect(mdPromise).resolves.not.toThrow();
212212
const md = await mdPromise;
213213
await expect(
214214
md.replace(/[\da-f]{40}/g, '`<commit-sha>`'),

packages/cli/src/lib/implementation/core-config.middleware.integration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('coreConfigMiddleware', () => {
5454
tsconfig: path.join(configDirPath, 'tsconfig.json'),
5555
...CLI_DEFAULTS,
5656
}),
57-
).resolves.toBe(true);
57+
).resolves.not.toThrow();
5858
});
5959

6060
it('should throw if --tsconfig is missing but needed to resolve import', async () => {

packages/core/src/lib/compare.unit.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('compareReportFiles', () => {
4747
const reportsDiffPromise = readJsonFile(
4848
path.join(MEMFS_VOLUME, 'report-diff.json'),
4949
);
50-
await expect(reportsDiffPromise).resolves.toBe(true);
50+
await expect(reportsDiffPromise).resolves.not.toThrow();
5151

5252
const reportsDiff = await reportsDiffPromise;
5353
expect(() => reportsDiffSchema.parse(reportsDiff)).not.toThrow();
@@ -243,7 +243,7 @@ describe('compareReports', () => {
243243
it('should contain all categories/groups/audits in unchanged arrays', () => {
244244
const reportsDiff = compareReports(mockReports);
245245
expect(reportsDiff.categories.unchanged).toHaveLength(
246-
mockReport.categories.length,
246+
mockReport.categories!.length,
247247
);
248248
expect(reportsDiff.groups.unchanged).toHaveLength(
249249
mockReport.plugins.reduce((acc, { groups }) => acc + groups!.length, 0),
@@ -273,7 +273,7 @@ describe('compareReports', () => {
273273
it('should only have added categories (minimal report has none)', () => {
274274
const reportsDiff = compareReports(mockReports);
275275
expect(reportsDiff.categories.added).toHaveLength(
276-
REPORT_MOCK.categories.length,
276+
REPORT_MOCK.categories!.length,
277277
);
278278
expect(reportsDiff.categories.removed).toHaveLength(0);
279279
expect(reportsDiff.categories.changed).toHaveLength(0);

0 commit comments

Comments
 (0)