mirror of
https://github.com/ivuorinen/gh-action-readme.git
synced 2026-02-12 17:48:55 +00:00
chore: even more linting, test fixes (#24)
* chore(lint): funcorder * chore(lint): yamlfmt, ignored broken test yaml files * chore(tests): tests do not output garbage, add coverage * chore(lint): fix editorconfig violations * chore(lint): move from eclint to editorconfig-checker * chore(lint): add pre-commit, run and fix * chore(ci): we use renovate to manage updates
This commit is contained in:
@@ -563,19 +563,18 @@ func TestGenerator_WithDifferentThemes(t *testing.T) {
|
||||
t.Parallel()
|
||||
themes := []string{"default", "github", "gitlab", "minimal", "professional"}
|
||||
|
||||
tmpDir, cleanup := testutil.TempDir(t)
|
||||
defer cleanup()
|
||||
|
||||
// Set up test templates
|
||||
testutil.SetupTestTemplates(t, tmpDir)
|
||||
|
||||
actionPath := filepath.Join(tmpDir, "action.yml")
|
||||
testutil.WriteTestFile(t, actionPath, testutil.MustReadFixture("actions/javascript/simple.yml"))
|
||||
|
||||
for _, theme := range themes {
|
||||
t.Run("theme_"+theme, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
// Templates are now embedded, no working directory changes needed
|
||||
// Create separate temp directory for each theme test
|
||||
tmpDir, cleanup := testutil.TempDir(t)
|
||||
defer cleanup()
|
||||
|
||||
// Set up test templates for this theme test
|
||||
testutil.SetupTestTemplates(t, tmpDir)
|
||||
|
||||
actionPath := filepath.Join(tmpDir, "action.yml")
|
||||
testutil.WriteTestFile(t, actionPath, testutil.MustReadFixture("actions/javascript/simple.yml"))
|
||||
|
||||
config := &AppConfig{
|
||||
Theme: theme,
|
||||
@@ -596,11 +595,6 @@ func TestGenerator_WithDifferentThemes(t *testing.T) {
|
||||
if len(readmeFiles) == 0 {
|
||||
t.Errorf("no output file was created for theme %s", theme)
|
||||
}
|
||||
|
||||
// Clean up for next test
|
||||
for _, file := range readmeFiles {
|
||||
_ = os.Remove(file)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user