Skip to content

Commit fb2929f

Browse files
authored
chore(testing): Move .snapshots to testdata (#785)
Committing dotfiles give me the creeps.
1 parent 004cf72 commit fb2929f

9 files changed

+6
-4
lines changed

.github/workflows/lint_markdown.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Vale
1616
uses: errata-ai/vale-action@v2
1717
with:
18-
vale_flags: "--glob=!{plugins/source/.snapshots/*,CHANGELOG.md,.github/styles/proselint/README.md}"
18+
vale_flags: "--glob=!{plugins/source/testdata/*,CHANGELOG.md,.github/styles/proselint/README.md}"
1919
filter_mode: nofilter
2020
env:
2121
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
@@ -29,4 +29,4 @@ jobs:
2929
with:
3030
files: .
3131
config_file: .markdownlint.yaml
32-
ignore_files: "CHANGELOG.md"
32+
ignore_files: '{plugins/source/testdata/*,CHANGELOG.md}'

plugins/source/docs_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ var testTables = []*schema.Table{
103103
func TestGeneratePluginDocs(t *testing.T) {
104104
p := NewPlugin("test", "v1.0.0", testTables, newTestExecutionClient)
105105

106+
cup := cupaloy.New(cupaloy.SnapshotSubdirectory("testdata"))
107+
106108
t.Run("Markdown", func(t *testing.T) {
107109
tmpdir := t.TempDir()
108110

@@ -117,7 +119,7 @@ func TestGeneratePluginDocs(t *testing.T) {
117119
output := path.Join(tmpdir, exp)
118120
got, err := os.ReadFile(output)
119121
require.NoError(t, err)
120-
cupaloy.SnapshotT(t, got)
122+
cup.SnapshotT(t, got)
121123
})
122124
}
123125
})
@@ -136,7 +138,7 @@ func TestGeneratePluginDocs(t *testing.T) {
136138
output := path.Join(tmpdir, exp)
137139
got, err := os.ReadFile(output)
138140
require.NoError(t, err)
139-
cupaloy.SnapshotT(t, got)
141+
cup.SnapshotT(t, got)
140142
})
141143
}
142144
})
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)