pax_global_header 0000666 0000000 0000000 00000000064 15110367761 0014521 g ustar 00root root 0000000 0000000 52 comment=a6352138aa161706548d999b53eb0c5b499f7e2f
go-snaps-0.5.16/ 0000775 0000000 0000000 00000000000 15110367761 0013341 5 ustar 00root root 0000000 0000000 go-snaps-0.5.16/.github/ 0000775 0000000 0000000 00000000000 15110367761 0014701 5 ustar 00root root 0000000 0000000 go-snaps-0.5.16/.github/FUNDING.yml 0000664 0000000 0000000 00000000026 15110367761 0016514 0 ustar 00root root 0000000 0000000 github: [gkampitakis]
go-snaps-0.5.16/.github/ISSUE_TEMPLATE/ 0000775 0000000 0000000 00000000000 15110367761 0017064 5 ustar 00root root 0000000 0000000 go-snaps-0.5.16/.github/ISSUE_TEMPLATE/bug.yml 0000664 0000000 0000000 00000001503 15110367761 0020363 0 ustar 00root root 0000000 0000000 name: š Bug report
description: Something doesn't work š„
title: '[Bug]: '
labels: ['bug']
body:
- type: textarea
id: description
attributes:
label: Description
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
id: steps-to-reproduce
attributes:
label: Steps to Reproduce
description: |
List of steps, sample code, screenshot(if visual bug), or a link to code or a project that reproduces the behavior.
The more details the faster will be to respond and potentially resolve the issue
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: Expected Behavior
description: A clear and concise description of what you expected to happen.
go-snaps-0.5.16/.github/ISSUE_TEMPLATE/feature.yml 0000664 0000000 0000000 00000001137 15110367761 0021244 0 ustar 00root root 0000000 0000000 name: š Feature Proposal
description: Submit a proposal for a new feature
title: '[Feature Request]: '
labels: ['enhancement']
body:
- type: textarea
id: proposal
attributes:
label: š Feature Proposal
description: A clear and concise description of what the feature is.
validations:
required: true
- type: textarea
id: motivation
attributes:
label: Motivation
description: The motivation for the proposal.
- type: textarea
id: example
attributes:
label: Example
description: An example for how this feature would be used.
go-snaps-0.5.16/.github/ISSUE_TEMPLATE/misc.yml 0000664 0000000 0000000 00000000341 15110367761 0020540 0 ustar 00root root 0000000 0000000 name: ā Other
description: Open an issue that is not feature or bug related
body:
- type: textarea
id: text
attributes:
label: Issue
description: Give as much detail as you can to help us understand.
go-snaps-0.5.16/.github/workflows/ 0000775 0000000 0000000 00000000000 15110367761 0016736 5 ustar 00root root 0000000 0000000 go-snaps-0.5.16/.github/workflows/go.yml 0000664 0000000 0000000 00000002221 15110367761 0020063 0 ustar 00root root 0000000 0000000 name: Go
on:
pull_request:
paths-ignore:
- "images/**"
- "**/*.md"
branches:
- main
push:
paths-ignore:
- "images/**"
- "**/*.md"
branches:
- main
jobs:
lint:
name: Run linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: "latest"
- name: Format lint
run: |
make install-tools && make format && git diff && git diff --quiet
test:
name: Run tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Run Tests
run: make test
- name: Run Tests
run: make test-trimpath
go-snaps-0.5.16/.gitignore 0000664 0000000 0000000 00000000441 15110367761 0015330 0 ustar 00root root 0000000 0000000 # Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, built with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Dependency directories (remove the comment below to include it)
vendor/
**/.DS_Store
.vscode
go-snaps-0.5.16/.golangci.yml 0000664 0000000 0000000 00000000636 15110367761 0015732 0 ustar 00root root 0000000 0000000 version: "2"
linters:
enable:
- lll
- revive
- staticcheck
- unconvert
- unparam
disable:
- errcheck
settings:
lll:
line-length: 130
revive:
rules:
- name: exported
disabled: true
exclusions:
paths:
- internal/difflib/difflib.go
formatters:
enable:
- goimports
- gofumpt
settings:
gofumpt:
extra-rules: true
go-snaps-0.5.16/LICENSE 0000664 0000000 0000000 00000002064 15110367761 0014350 0 ustar 00root root 0000000 0000000 MIT License
Copyright (c) 2021 Georgios Kampitakis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
go-snaps-0.5.16/Makefile 0000664 0000000 0000000 00000001441 15110367761 0015001 0 ustar 00root root 0000000 0000000 .PHONY: install-tools lint test test-verbose format help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
install-tools: ## Install linting tools
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
go install mvdan.cc/gofumpt@latest
go install github.com/segmentio/golines@latest
lint: ## Run golangci linter
golangci-lint run ./...
format: ## Format code
gofumpt -l -w -extra .
golines . -w
test: ## Run tests
go test -race -count=10 -shuffle on -cover ./...
test-verbose: ## Run tests with verbose output
go test -race -count=10 -shuffle on -v -cover ./...
test-trimpath: ## Run tests with -trimpath
GOFLAGS=-trimpath go test -race -count=10 -shuffle on -v -cover ./examples
go-snaps-0.5.16/README.md 0000664 0000000 0000000 00000037144 15110367761 0014631 0 ustar 00root root 0000000 0000000 # Go Snaps
[](https://github.com/gkampitakis/go-snaps/actions/workflows/go.yml)
[](https://goreportcard.com/report/github.com/gkampitakis/go-snaps)
[](https://pkg.go.dev/github.com/gkampitakis/go-snaps)
Jest-like snapshot testing in Go
## Contents
- [Installation](#installation)
- [MatchSnapshot](#matchsnapshot)
- [MatchStandaloneSnapshot](#matchstandalonesnapshot)
- [MatchJSON](#matchjson)
- [MatchStandaloneJSON](#matchstandalonejson)
- [MatchYAML](#matchyaml)
- [MatchStandaloneYAML](#matchstandaloneyaml)
- [MatchInlineSnapshot](#matchinlinesnapshot) `Experimental`
- [Matchers](#matchers)
- [match.Any](#matchany)
- [match.Custom](#matchcustom)
- [match.Type\[ExpectedType\]](#matchtype)
- [Configuration](#configuration)
- [Update Snapshots](#update-snapshots)
- [Clean obsolete Snapshots](#clean-obsolete-snapshots)
- [Sort Snapshots](#sort-snapshots)
- [Skipping Tests](#skipping-tests)
- [Running tests on CI](#running-tests-on-ci)
- [No Color](#no-color)
- [Snapshots Structure](#snapshots-structure)
- [Known Limitations](#known-limitations)
- [Acknowledgments](#acknowledgments)
- [Contributing](./contributing.md)
## Installation
To install `go-snaps`, use `go get`:
```bash
go get github.com/gkampitakis/go-snaps
```
Import the `go-snaps/snaps` package into your code:
```go
package example
import (
"testing"
"github.com/gkampitakis/go-snaps/snaps"
)
func TestExample(t *testing.T) {
snaps.MatchSnapshot(t, "Hello World")
}
```
## MatchSnapshot
`MatchSnapshot` can be used to capture any type of data structured or unstructured.
You can pass multiple parameters to `MatchSnapshot` or call `MatchSnapshot` multiple
times inside the same test. The difference is in the latter, it will
create multiple entries in the snapshot file.
```go
// test_simple.go
func TestSimple(t *testing.T) {
t.Run("should make multiple entries in snapshot", func(t *testing.T) {
snaps.MatchSnapshot(t, 5, 10, 20, 25)
snaps.MatchSnapshot(t, "some value")
})
}
```
`go-snaps` saves the snapshots in `__snapshots__` directory and the file
name is the test file name with extension `.snap`.
So for example if your test is called `test_simple.go` when you run your tests, a snapshot file
will be created at `./__snapshots__/test_simple.snaps`.
## MatchStandaloneSnapshot
`MatchStandaloneSnapshot` will create snapshots on separate files as opposed to `MatchSnapshot` which adds multiple snapshots inside the same file.
_Combined with `snaps.Ext` you can have proper syntax highlighting and better readability_
```go
// test_simple.go
func TestSimple(t *testing.T) {
snaps.MatchStandaloneSnapshot(t, "Hello World")
// or create an html snapshot file
snaps.WithConfig(snaps.Ext(".html")).
MatchStandaloneSnapshot(t, "Hello World
")
}
```
`go-snaps` saves the snapshots in `__snapshots__` directory and the file
name is the `t.Name()` plus a number plus the extension `.snap`.
So for the above example the snapshot file name will be `./__snapshots__/TestSimple_1.snap` and `./__snapshots__/TestSimple_1.snap.html`.
## MatchJSON
`MatchJSON` can be used to capture data that can represent a valid json.
You can pass a valid json in form of `string` or `[]byte` or whatever value can be passed
successfully on `json.Marshal`.
```go
func TestJSON(t *testing.T) {
type User struct {
Age int
Email string
}
snaps.MatchJSON(t, `{"user":"mock-user","age":10,"email":"mock@email.com"}`)
snaps.MatchJSON(t, []byte(`{"user":"mock-user","age":10,"email":"mock@email.com"}`))
snaps.MatchJSON(t, User{10, "mock-email"})
}
```
JSON will be saved in snapshot in pretty format for more readability and deterministic diffs.
## MatchStandaloneJSON
`MatchStandaloneJSON` will create snapshots on separate files as opposed to `MatchJSON` which adds multiple snapshots inside the same file.
```go
func TestSimple(t *testing.T) {
snaps.MatchStandaloneJSON(t, `{"user":"mock-user","age":10,"email":"mock@email.com"}`)
snaps.MatchStandaloneJSON(t, User{10, "mock-email"})
}
```
`go-snaps` saves the snapshots in `__snapshots__` directory and the file
name is the `t.Name()` plus a number plus the extension `.snap.json`.
So for the above example the snapshot file name will be `./__snapshots__/TestSimple_1.snap.json` and `./__snapshots__/TestSimple_2.snap.json`.
## MatchYAML
`MatchYAML` can be used to capture data that can represent a valid yaml.
You can pass a valid json in form of `string` or `[]byte` or whatever value can be passed
successfully on `yaml.Marshal`.
```go
func TestYAML(t *testing.T) {
type User struct {
Age int
Email string
}
snaps.MatchYAML(t, "user: \"mock-user\"\nage: 10\nemail: mock@email.com")
snaps.MatchYAML(t, []byte("user: \"mock-user\"\nage: 10\nemail: mock@email.com"))
snaps.MatchYAML(t, User{10, "mock-email"})
}
```
## MatchStandaloneYAML
`MatchStandaloneYAML` will create snapshots on separate files as opposed to `MatchYAML` which adds multiple snapshots inside the same file.
```go
func TestSimple(t *testing.T) {
snaps.MatchStandaloneYAML(t, "user: \"mock-user\"\nage: 10\nemail: \"mock@email.com\"")
snaps.MatchStandaloneYAML(t, User{10, "mock-email"})
}
```
`go-snaps` saves the snapshots in `__snapshots__` directory and the file
name is the `t.Name()` plus a number plus the extension `.snap.yaml`.
So for the above example the snapshot file name will be `./__snapshots__/TestSimple_1.snap.yaml` and `./__snapshots__/TestSimple_2.snap.yaml`.
### Matchers
`MatchJSON`'s and `MatchYAML`'s third argument can accept a list of matchers. Matchers are functions that can act
as property matchers and test values.
You can pass the path of the property you want to match and test.
Currently `go-snaps` has three build in matchers
- `match.Any`
- `match.Custom`
- `match.Type[ExpectedType]`
_Open to feedback for building more matchers or you can build your own [example](./examples/matchJSON_test.go#L16)._
#### Path Syntax
For JSON go-snaps utilises gjson.
_More information about the supported path syntax from [gjson](https://github.com/tidwall/gjson/blob/v1.17.0/SYNTAX.md)._
As for YAML go-snaps utilises [github.com/goccy/go-yaml#5-use-yamlpath](https://github.com/goccy/go-yaml#5-use-yamlpath).
_More information about the supported syntax [PathString](https://github.com/goccy/go-yaml/blob/9cbf5d4217830fd4ad1504e9ed117c183ade0994/path.go#L17-L26)._
#### match.Any
Any matcher acts as a placeholder for any value. It replaces any targeted path with a
placeholder string.
```go
Any("user.name")
// or with multiple paths
Any("user.name", "user.email")
```
Any matcher provides some methods for setting options
```go
match.Any("user.name").
Placeholder(value). // allows to define a different placeholder value from the default ""
ErrOnMissingPath(bool) // determines whether the matcher will err in case of a missing, default true
```
#### match.Custom
Custom matcher allows you to bring your own validation and placeholder value
```go
match.Custom("user.age", func(val any) (any, error) {
age, ok := val.(float64)
if !ok {
return nil, fmt.Errorf("expected number but got %T", val)
}
return "some number", nil
})
```
The callback parameter value for JSON can be on of these types:
```go
bool // for JSON booleans
float64 // for JSON numbers
string // for JSON string literals
nil // for JSON null
map[string]any // for JSON objects
[]any // for JSON arrays
```
If Custom matcher returns an error the snapshot test will fail with that error.
Custom matcher provides a method for setting an option
```go
match.Custom("path",myFunc).
Placeholder(value). // allows to define a different placeholder value from the default ""
ErrOnMissingPath(bool) // determines whether the matcher will err in case of a missing path, default true
```
#### match.Type
Type matcher evaluates types that are passed in a snapshot and it replaces any targeted path with a placeholder in the form of ``.
```go
match.Type[string]("user.info")
// or with multiple paths
match.Type[float64]("user.age", "data.items")
```
Type matcher provides a method for setting an option
```go
match.Type[string]("user.info").
ErrOnMissingPath(bool) // determines whether the matcher will err in case of a missing path, default true
```
You can see more [examples](./examples/matchJSON_test.go#L96).
## MatchInlineSnapshot
`MatchInlineSnapshot` allows you to store expected snapshot values directly within your test source code, rather than in external snapshot files.
**First run** - Create the snapshot by passing `nil` on the last argument:
```go
func TestInlineSnapshot(t *testing.T) {
snaps.MatchInlineSnapshot(t, "Hello World", nil)
snaps.MatchInlineSnapshot(t, 123, nil)
snaps.MatchInlineSnapshot(t, map[string]int{"foo": 1, "bar": 2}, nil)
}
```
Then run your tests, and `go-snaps` will automatically insert the snapshot into your test code.
```go
func TestInlineSnapshot(t *testing.T) {
snaps.MatchInlineSnapshot(t, "Hello World", snaps.Inline("Hello World"))
snaps.MatchInlineSnapshot(t, 123, snaps.Inline("int(123)"))
snaps.MatchInlineSnapshot(t, map[string]int{"foo": 1, "bar": 2}, snaps.Inline(`map[string]int{"bar":2, "foo":1}`))
}
```
Every subsequent test run will compare the actual value against the inline snapshot, and if they differ, the test will fail and display a diff.
> [!NOTE]
> `MatchInlineSnapshot` is experimental and looking for feedback and thorough testing before being marked as stable.
## Configuration
`go-snaps` allows passing configuration for overriding
- the directory where snapshots are stored, _relative or absolute path_
- the filename where snapshots are stored
- the snapshot file's extension (_regardless the extension the filename will include the `.snaps` inside the filename_)
- programmatically control whether to update snapshots. _You can find an example usage at [examples](/examples/examples_test.go#13)_
- json config's json format configuration:
- `Width`: The maximum width in characters before wrapping json output (default: 80)
- `Indent`: The indentation string to use for nested structures (default: 1 spaces)
- `SortKeys`: Whether to sort json object keys alphabetically (default: true)
```go
t.Run("snapshot tests", func(t *testing.T) {
snaps.WithConfig(snaps.Filename("my_custom_name"), snaps.Dir("my_dir")).MatchSnapshot(t, "Hello Word")
s := snaps.WithConfig(
snaps.Dir("my_dir"),
snaps.Filename("json_file"),
snaps.Ext(".json"),
snaps.Update(false),
snaps.JSON(snaps.JSONConfig{
Width: 80,
Indent: " ",
SortKeys: false,
}),
)
s.MatchJSON(t, `{"hello":"world"}`)
})
```
You can see more on [examples](/examples/matchSnapshot_test.go#L67)
## Update Snapshots
You can update your failing snapshots by setting `UPDATE_SNAPS` env variable to true.
```bash
UPDATE_SNAPS=true go test ./...
```
If you don't want to update all failing snapshots, or you want to update only one of
them you can you use the `-run` flag to target the test(s) you want.
For more information on `go test` flags you can run
```go
go help testflag
```
### Clean obsolete snapshots
`go-snaps` can identify obsolete snapshots.
In order to enable this functionality you need to use `TestMain(m *testing.M)` to
call `snaps.Clean(t)` after your tests have run. This will also print a **Snapshot Summary**. (if running tests
with verbose flag `-v`)
If you want to remove the obsolete snap files and snapshots you can run
tests with `UPDATE_SNAPS=clean` env variable.
The reason for using `TestMain` is because `go-snaps` needs to be sure that all tests
are finished so it can keep track of which snapshots were not called.
**Example:**
```go
func TestMain(m *testing.M) {
v := m.Run()
// After all tests have run `go-snaps` can check for unused snapshots
snaps.Clean(m)
// dirty, err := snaps.Clean(m)
// _ = err
// if dirty {
// fmt.Println("Some snapshots were outdated.")
// os.Exit(1)
// }
os.Exit(v)
}
```
For more information around [TestMain](https://pkg.go.dev/testing#hdr-Main).
### Sort Snapshots
By default `go-snaps` appends new snaps to the snapshot file and in case of parallel tests the order is random. If you want snaps to be sorted in deterministic order you need to use `TestMain` per package:
```go
func TestMain(m *testing.M) {
v := m.Run()
// After all tests have run `go-snaps` will sort snapshots
snaps.Clean(m, snaps.CleanOpts{Sort: true})
os.Exit(v)
}
```
### Skipping Tests
If you want to skip one test using `t.Skip`, `go-snaps` can't keep track
if the test was skipped or if it was removed. For that reason `go-snaps` exposes
a wrapper for `t.Skip`, `t.Skipf` and `t.SkipNow`, which keep tracks of skipped files.
You can skip, or only run specific tests by using the `-run` flag. `go-snaps`
can identify which tests are being skipped and parse only the relevant tests
for obsolete snapshots.
## Running Tests on CI
When `go-snaps` detects that it is running in CI it will automatically fail when snapshots are missing or there diffs. This is done to ensure new snapshots are committed alongside the tests and assertions are successful.
You can override this behavior by setting `UPDATE_SNAPS` to `always` when running your tests that will create or update snapshots.
> `go-snaps` uses [ciinfo](https://github.com/gkampitakis/ciinfo) for detecting if it runs on CI environment.
## No Color
`go-snaps` supports disabling color outputs by running your tests with the env variable
`NO_COLOR` set to any value.
```bash
NO_COLOR=true go test ./...
```
For more information around [NO_COLOR](https://no-color.org).
## Snapshots Structure
Snapshots have the form
```text
[TestName - Number]
---
```
`TestID` is the test name plus an increasing number to allow multiple calls of `MatchSnapshot` in a single test.
```txt
[TestSimple/should_make_a_map_snapshot - 1]
map[string]any{
"mock-0": "value",
"mock-1": int(2),
"mock-2": func() {...},
"mock-3": float32(10.399999618530273),
}
---
```
> [!NOTE]
> If your snapshot data contain characters `---` at the start of a line followed by a new line, `go-snaps` will "escape" them and save them as `/-/-/-/` to differentiate them from termination characters.
## Known Limitations
- When running a specific test file by specifying a path `go test ./my_test.go`, `go-snaps` can't track the path so it will mistakenly mark snapshots as obsolete.
- go-snaps doesn't handle CRLF line endings. If you are using Windows, you may need to convert the line endings to LF.
- go-snaps cannot determine the snapshot path automatically when running with `go test -trimpath ./...`. It then instead relies on the current working directory to define the snapshot directory. If this is a problem in your use case you can set an absolute path with `snaps.WithConfig(snaps.Dir("/some/absolute/path"))`
## Acknowledgments
This library used [Jest Snapshoting](https://jestjs.io/docs/snapshot-testing) and [Cupaloy](https://github.com/bradleyjkemp/cupaloy) as inspiration.
- Jest is a full-fledged Javascript testing framework and has robust snapshoting features.
- Cupaloy is a great and simple Golang snapshoting solution.
- The [logo](https://github.com/MariaLetta/free-gophers-pack) was made by [MariaLetta](https://github.com/MariaLetta).
go-snaps-0.5.16/contributing.md 0000664 0000000 0000000 00000001270 15110367761 0016372 0 ustar 00root root 0000000 0000000
# Contributing
go-snaps is a pet open-source project. That means there are no any sorts of guarantees but
I am happy to review any contribution to help the project improve.
## Running Locally
Running the project locally is straight forward. You will need `go>=1.16` version installed.
In the project there is an `examples` folder where you can experiment and test how `go-snaps` works. You can run the tests with
```go
go test ./examples/... -v -race -count=1
```
## Creating a pr
Before making a pull request make sure your changes are linted and formatted else GH actions will fail.
In the root of the project there is a `Makefile`. You can run `make help` for the list of commands.
go-snaps-0.5.16/examples/ 0000775 0000000 0000000 00000000000 15110367761 0015157 5 ustar 00root root 0000000 0000000 go-snaps-0.5.16/examples/__snapshots__/ 0000775 0000000 0000000 00000000000 15110367761 0017775 5 ustar 00root root 0000000 0000000 TestMatchStandaloneJSON_matchers_Any_matcher_should_ignore_fields_1.snap.json 0000775 0000000 0000000 00000000125 15110367761 0037040 0 ustar 00root root 0000000 0000000 go-snaps-0.5.16/examples/__snapshots__ {
"age": 10,
"nested": {
"now": [
""
]
},
"user": "mock-user"
} TestMatchStandaloneJSON_matchers_Custom_matcher_JSON_string_validation_1.snap.json 0000775 0000000 0000000 00000000121 15110367761 0037741 0 ustar 00root root 0000000 0000000 go-snaps-0.5.16/examples/__snapshots__ {
"age": "",
"email": "mock@email.com",
"user": "mock-user"
} TestMatchStandaloneJSON_matchers_Custom_matcher_struct_marshalling_1.snap.json 0000775 0000000 0000000 00000000140 15110367761 0037276 0 ustar 00root root 0000000 0000000 go-snaps-0.5.16/examples/__snapshots__ {
"email": "mock-user@email.com",
"keys": [
1,
2,
3,
4,
5
],
"name": "mock-user"
} 78d60ee26285b161eb01a6e2031017213de31244.paxheader 0000666 0000000 0000000 00000000227 15110367761 0020105 x ustar 00root root 0000000 0000000 151 path=go-snaps-0.5.16/examples/__snapshots__/TestMatchStandaloneJSON_matchers_Type_matcher_should_create_snapshot_with_type_placeholder_1.snap.json
78d60ee26285b161eb01a6e2031017213de31244.data 0000775 0000000 0000000 00000000035 15110367761 0016743 0 ustar 00root root 0000000 0000000 {
"data": ""
} a96108fdc24343ff1b899fd4d35c28506fad0ce1.paxheader 0000666 0000000 0000000 00000000227 15110367761 0020607 x ustar 00root root 0000000 0000000 151 path=go-snaps-0.5.16/examples/__snapshots__/TestMatchStandaloneJSON_matchers_Type_matcher_should_create_snapshot_with_type_placeholder_2.snap.json
a96108fdc24343ff1b899fd4d35c28506fad0ce1.data 0000775 0000000 0000000 00000000061 15110367761 0017444 0 ustar 00root root 0000000 0000000 {
"metadata": ""
} TestMatchStandaloneJSON_should_create_a_prettyJSON_snap_1.snap.json 0000775 0000000 0000000 00000000100 15110367761 0034705 0 ustar 00root root 0000000 0000000 go-snaps-0.5.16/examples/__snapshots__ {
"age": 10,
"email": "mock@email.com",
"user": "mock-user"
} TestMatchStandaloneJSON_should_create_a_prettyJSON_snap_2.snap.json 0000775 0000000 0000000 00000000100 15110367761 0034706 0 ustar 00root root 0000000 0000000 go-snaps-0.5.16/examples/__snapshots__ {
"age": 10,
"email": "mock@email.com",
"user": "mock-user"
} TestMatchStandaloneJSON_should_create_a_prettyJSON_snap_following_by_config_1.snap.json 0000775 0000000 0000000 00000000111 15110367761 0041006 0 ustar 00root root 0000000 0000000 go-snaps-0.5.16/examples/__snapshots__ {
"user": "mock-user",
"age": 10,
"email": "mock@email.com"
} TestMatchStandaloneJSON_should_create_a_prettyJSON_snap_following_by_config_2.snap.json 0000775 0000000 0000000 00000000111 15110367761 0041007 0 ustar 00root root 0000000 0000000 go-snaps-0.5.16/examples/__snapshots__ {
"user": "mock-user",
"age": 10,
"email": "mock@email.com"
} TestMatchStandaloneJSON_should_make_a_json_object_snapshot_1.snap.json 0000775 0000000 0000000 00000000135 15110367761 0035543 0 ustar 00root root 0000000 0000000 go-snaps-0.5.16/examples/__snapshots__ {
"mock-0": "value",
"mock-1": 2,
"mock-2": {
"Msg": "Hello World"
},
"mock-3": 10.4
} go-snaps-0.5.16/examples/__snapshots__/TestMatchStandaloneJSON_should_marshal_struct_1.snap.json 0000775 0000000 0000000 00000000133 15110367761 0033140 0 ustar 00root root 0000000 0000000 {
"email": "mock@email.com",
"keys": [
1,
2,
3,
4,
5
],
"name": "mock-name"
} TestMatchStandaloneSnapshot_should_create_html_snapshots_1.snap.html 0000775 0000000 0000000 00000000147 15110367761 0035445 0 ustar 00root root 0000000 0000000 go-snaps-0.5.16/examples/__snapshots__
My First Heading
My first paragraph.
TestMatchStandaloneSnapshot_should_create_html_snapshots_2.snap.html 0000775 0000000 0000000 00000000026 15110367761 0035442 0 ustar 00root root 0000000 0000000 go-snaps-0.5.16/examples/__snapshots__ Hello World