Skip to content

Commit a9048f8

Browse files
authored
test: strengthen price regex tests (#865)
1 parent 606efc5 commit a9048f8

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

test/commerce.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ describe('commerce', () => {
146146
expect(
147147
amount,
148148
'The expected match should not include a currency symbol'
149-
).match(/[0-9.]/);
149+
).toMatch(/^[0-9\.]+$/);
150150
});
151151

152152
it('should handle negative amounts, but return 0', () => {

test/finance.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ describe('finance', () => {
230230
expect(
231231
amount,
232232
'The expected match should not include a currency symbol'
233-
).match(/[0-9.]/);
233+
).toMatch(/^[0-9\.]+$/);
234234
});
235235

236236
it('it should handle negative amounts', () => {

0 commit comments

Comments
 (0)