(t *testing.T)
| 502 | } |
| 503 | |
| 504 | func 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 | |
| 528 | const ( |
| 529 | binCoderSha1 = "bin/coder.sha1" |
nothing calls this directly
no test coverage detected