Skip to content

Commit

Permalink
normalize whitespace before comparing timestamps in jest (#3277)
Browse files Browse the repository at this point in the history
  • Loading branch information
mastercactapus authored Sep 13, 2023
1 parent b738103 commit 96090f2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web/src/app/util/timeFormat.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import {
describe('formatTimestamp', () => {
const check = (opts: FormatTimestampArg, exp: string): void => {
it(`${opts.time} === ${exp}`, () => {
expect(formatTimestamp(opts)).toBe(exp)
// different versions of node have different whitespace, so normalize it
const result = formatTimestamp(opts).replace(/[\s\u00A0\u202F]+/g, ' ')
expect(result).toBe(exp)
})
}

Expand Down

0 comments on commit 96090f2

Please sign in to comment.