Skip to content

Commit

Permalink
add missing string test
Browse files Browse the repository at this point in the history
  • Loading branch information
hoeck committed Dec 6, 2023
1 parent 1744f62 commit 44a572e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/string.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,17 @@ describe('string', () => {
})

it('trims before applying match', () => {
const rt = st.string({ match: /^[0-9a-f]{8}$/ })
const rt = st.string({ match: /^[0-9a-f]{8}$/, trim: true })

expectAcceptValuesImpure(
rt,
[
[' affeaffe', 'affeaffe'],
[' affeaffe ', 'affeaffe'],
],
true,
)

expectRejectValues(rt, [' affea ffe ', ' '])
})
})

0 comments on commit 44a572e

Please sign in to comment.