You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`MatchJSON`'s third argument can accept a list of matchers. Matchers are functions that can act
156
+
`MatchJSON`'s and `MatchYAML`'s third argument can accept a list of matchers. Matchers are functions that can act
113
157
as property matchers and test values.
114
158
115
159
You can pass the path of the property you want to match and test.
116
160
117
-
_More information about the supported path syntax from [gjson](https://github.com/tidwall/gjson/blob/v1.17.0/SYNTAX.md)._
118
-
119
161
Currently `go-snaps` has three build in matchers
120
162
121
163
-`match.Any`
122
164
-`match.Custom`
123
165
-`match.Type[ExpectedType]`
124
166
167
+
_Open to feedback for building more matchers or you can build your own [example](./examples/matchJSON_test.go#L16)._
168
+
169
+
#### Path Syntax
170
+
171
+
For JSON go-snaps utilises gjson.
172
+
173
+
_More information about the supported path syntax from [gjson](https://github.com/tidwall/gjson/blob/v1.17.0/SYNTAX.md)._
174
+
175
+
As for YAML go-snaps utilises [github.com/goccy/go-yaml#5-use-yamlpath](https://github.com/goccy/go-yaml#5-use-yamlpath).
176
+
177
+
_More information about the supported syntax [PathString](https://github.com/goccy/go-yaml/blob/9cbf5d4217830fd4ad1504e9ed117c183ade0994/path.go#L17-L26)._
178
+
125
179
#### match.Any
126
180
127
181
Any matcher acts as a placeholder for any value. It replaces any targeted path with a
0 commit comments