MCPcopy Index your code
hub / github.com/coder/coder / TestShouldCacheFile

Function TestShouldCacheFile

site/site_test.go:504–526  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

502}
503
504func TestShouldCacheFile(t *testing.T) {
505 t.Parallel()
506
507 testCases := []struct {
508 reqFile string
509 expected bool
510 }{
511 {"123456789.js", true},
512 {"apps/app/code/terminal.css", true},
513 {"image.png", true},
514 {"static/image.png", true},
515 {"static/images/section-a/image.jpeg", true},
516
517 {"service-worker.js", false},
518 {"dashboard.html", false},
519 {"apps/app/code/terminal.html", false},
520 }
521
522 for _, testCase := range testCases {
523 got := site.ShouldCacheFile(testCase.reqFile)
524 require.Equal(t, testCase.expected, got, fmt.Sprintf("Expected ShouldCacheFile(%s) to be %t", testCase.reqFile, testCase.expected))
525 }
526}
527
528const (
529 binCoderSha1 = "bin/coder.sha1"

Callers

nothing calls this directly

Calls 2

ShouldCacheFileFunction · 0.92
EqualMethod · 0.45

Tested by

no test coverage detected