Skip to content

Commit 9e27ef2

Browse files
committed
test: allow optional content watch metrics
1 parent 1bc2cd9 commit 9e27ef2

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

e2e/watch/hot-update/shared.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -659,18 +659,17 @@ function assertHotUpdateReport(report: HotUpdateReport, target: WatchCaseName, m
659659
const styleMetric = item.mutationMetrics.find(mutation => mutation.mutationKind === 'style')
660660

661661
expect(templateMetric).toBeDefined()
662-
expect(contentMetric).toBeDefined()
663662
expect(scriptMetric).toBeDefined()
664663
expect(styleMetric).toBeDefined()
665664

666665
expect(templateMetric?.hotUpdateEffectiveMs).toBeGreaterThan(0)
667-
expect(contentMetric?.hotUpdateEffectiveMs).toBeGreaterThan(0)
668666
expect(scriptMetric?.hotUpdateEffectiveMs).toBeGreaterThan(0)
669667
expect(templateMetric?.hotUpdateEffectiveMs).toBeLessThanOrEqual(maxHotUpdateMs)
670-
expect(contentMetric?.hotUpdateEffectiveMs).toBeLessThanOrEqual(maxHotUpdateMs)
671668
expect(scriptMetric?.hotUpdateEffectiveMs).toBeLessThanOrEqual(maxHotUpdateMs)
672669

673670
if (contentMetric && contentMetric.mutationKind !== 'style') {
671+
expect(contentMetric.hotUpdateEffectiveMs).toBeGreaterThan(0)
672+
expect(contentMetric.hotUpdateEffectiveMs).toBeLessThanOrEqual(maxHotUpdateMs)
674673
expect(contentMetric.sourceFile).not.toMatch(INDEX_HTML_RE)
675674
const canContainTemplate = TEMPLATE_SOURCE_FILE_RE.test(contentMetric.sourceFile)
676675
const canContainScript = SCRIPT_SOURCE_FILE_RE.test(contentMetric.sourceFile)

0 commit comments

Comments
 (0)