Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -953,8 +953,9 @@ async function runScan(
return 0;
}

const checked = `Checked ${plural(stats.uniqueNames, 'package', 'packages')}`;
report.checked = stats.uniqueNames;
// Name@version entries, the count the dashboard shows for the same manifest.
const checked = `Checked ${plural(payload.packages.length, 'package', 'packages')}`;
report.checked = payload.packages.length;
if (response.stored) {
report.done.unshift(checked);
say(`Stored manifest #${response.manifest_id} (checksum ${response.checksum}).`);
Expand Down
16 changes: 16 additions & 0 deletions tests/bin-invocation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,22 @@ describe.skipIf(!built)('the packaged bin, invoked as npm invokes it', () => {
}
});

it('counts the package versions it sent, as the dashboard does, not the package names', async () => {
const server = await acceptingServer();
const dir = freshProject();
try {
const stdout = await scan(dir, server.endpoint, {}, ['--verbose']);

const [, versions, names] = stdout.match(/Found (\d+) package versions across (\d+) packages/) ?? [];
expect(Number(versions)).toBeGreaterThan(Number(names));
expect(stdout).toContain(`Checked ${versions} packages`);
expect(stdout).not.toContain(`Checked ${names} packages`);
} finally {
await server.close();
rmSync(dir, { recursive: true, force: true });
}
});

it('marks the local sync done and names connecting as the one next step', async () => {
const server = await acceptingServer();
const dir = freshProject();
Expand Down