mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
fix(testing/snapshot): distinguish between singular and plural forms (#3625)
This commit is contained in:
parent
b5c321d82e
commit
51cfcb65d8
@ -215,7 +215,7 @@ snapshot[`Snapshot Test - Options > mode 2`] = `
|
||||
snapshot ... ok (--ms)
|
||||
------- output -------
|
||||
|
||||
> 1 snapshots updated.
|
||||
> 1 snapshot updated.
|
||||
|
||||
ok | 1 passed | 0 failed (--ms)
|
||||
|
||||
@ -227,7 +227,7 @@ snapshot[`Snapshot Test - Update - New snapshot 1`] = `
|
||||
Snapshot Test - Update ... ok (--ms)
|
||||
------- output -------
|
||||
|
||||
> 1 snapshots updated.
|
||||
> 1 snapshot updated.
|
||||
|
||||
ok | 1 passed | 0 failed (--ms)
|
||||
|
||||
@ -272,7 +272,7 @@ snapshot[`Snapshot Test - Update - Existing snapshot - updates 1`] = `
|
||||
Snapshot Test - Update ... ok (--ms)
|
||||
------- output -------
|
||||
|
||||
> 1 snapshots updated.
|
||||
> 1 snapshot updated.
|
||||
|
||||
ok | 1 passed | 0 failed (--ms)
|
||||
|
||||
@ -301,7 +301,7 @@ Snapshot Test - Second ... ok (--ms)
|
||||
|
||||
> 2 snapshots updated.
|
||||
|
||||
> 1 snapshots removed.
|
||||
> 1 snapshot removed.
|
||||
• Snapshot Test - Update 1
|
||||
|
||||
ok | 2 passed | 0 failed (--ms)
|
||||
@ -361,7 +361,7 @@ Snapshot Test - Remove - Fourth ... ok (--ms)
|
||||
Snapshot Test - Remove - Fifth ... ok (--ms)
|
||||
------- output -------
|
||||
|
||||
> 1 snapshots removed.
|
||||
> 1 snapshot removed.
|
||||
• Snapshot Test - Remove - Third 1
|
||||
|
||||
ok | 4 passed | 0 failed (--ms)
|
||||
@ -410,7 +410,7 @@ Snapshot Test - First ... ok (--ms)
|
||||
Snapshot Test - Second ... ok (--ms)
|
||||
------- output -------
|
||||
|
||||
> 1 snapshots updated.
|
||||
> 1 snapshot updated.
|
||||
running 2 tests from <tempDir>/test.ts
|
||||
Snapshot Test - First ...----- output end -----
|
||||
Snapshot Test - First ... ok (--ms)
|
||||
|
@ -347,13 +347,25 @@ class AssertSnapshotContext {
|
||||
const updated = this.getUpdatedCount();
|
||||
if (updated > 0) {
|
||||
console.log(
|
||||
green(bold(`\n > ${updated} snapshots updated.`)),
|
||||
green(
|
||||
bold(
|
||||
`\n > ${updated} ${
|
||||
updated === 1 ? "snapshot" : "snapshots"
|
||||
} updated.`,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
const removed = removedSnapshotNames.length;
|
||||
if (removed > 0) {
|
||||
console.log(
|
||||
red(bold(`\n > ${removed} snapshots removed.`)),
|
||||
red(
|
||||
bold(
|
||||
`\n > ${removed} ${
|
||||
removed === 1 ? "snapshot" : "snapshots"
|
||||
} removed.`,
|
||||
),
|
||||
),
|
||||
);
|
||||
for (const snapshotName of removedSnapshotNames) {
|
||||
console.log(
|
||||
|
Loading…
Reference in New Issue
Block a user