GitHub actions migration (#540)

This commit is contained in:
Dan Sosedoff
2021-12-25 11:31:41 -06:00
committed by GitHub
parent b1b50045a5
commit ccfa3497f3
3 changed files with 71 additions and 27 deletions

View File

@@ -21,7 +21,20 @@ func Test_assetContentType(t *testing.T) {
"foo": "text/plain; charset=utf-8",
}
alternatives := map[string]string{
"foo.js": "text/javascript; charset=utf-8",
}
for name, expected := range samples {
assert.Equal(t, expected, assetContentType(name))
if alternatives[name] == "" {
assert.Equal(t, expected, assetContentType(name))
continue
}
actual := assetContentType(name)
if actual != expected && actual != alternatives[name] {
t.Errorf("expected %v but got %v (alternative value failed)", expected, actual)
}
}
}