denoland / denoland/std

"assertSnapshot" should add support for wildcards

Open
#2,147 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3.6k
Forks
681
PR merge metrics
No merged PRs in 30d

Description

> One more thing I'd love to see is an alternative serializer provided as an exported function - the serializer should match using wildcards, ie. we want to assert the shape of the object but certain values don't need to match exactly. This is useful if there are dates/time measurements.

Originally posted by @bartlomieju in [#2135 (comment)](https://github.com/denoland/deno_std/issues/2135#issuecomment-1107461840)

> Wildcard matching is powerful and desirable feature (We already needed something like this in our test cases. [ref](https://github.com/denoland/deno_std/blob/3b7aca1842a697daee7833310ff1bb9c049c73ea/testing/snapshot_test.ts#L106-L109)).
>
> FYI Deno CLI uses the format like [this](https://github.com/denoland/deno/blob/d2c80aa26f30cfc3d614ff313a8dfe4c2c534cd1/cli/tests/testdata/022_info_flag_script.out) (The matcher is implemented by ourselves)

Originally posted by @kt3k in [#2135 (comment)](https://github.com/denoland/deno_std/issues/2135#issuecomment-1107523590)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.