Skip to content

Commit db01bbe

Browse files
committed
skip test if file not found
1 parent 3426da5 commit db01bbe

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

xbarapp.com/main_test.go

+7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ func TestPluginMetadata(t *testing.T) {
1818
is := is.New(t)
1919

2020
pluginMetadataPath := filepath.Join(docsFolder, "/plugins/Dev/Tutorial/cycle_text_and_detail.sh.json")
21+
22+
// if the file doesn't exist - skip the test
23+
if _, err := os.Stat(pluginMetadataPath); os.IsNotExist(err) {
24+
t.Skipf("file %s doesn't exist", pluginMetadataPath)
25+
return
26+
}
27+
2128
p := loadPluginMetadata(is, pluginMetadataPath)
2229
is.True(p.Version != "") // version doesn't match
2330
is.True(p.LastUpdated != "")

0 commit comments

Comments
 (0)