11import { describe , it , afterEach , mock } from 'node:test' ;
22import assert from 'node:assert/strict' ;
3- import { createTestServer , fetchText , expectIncludes } from '@web/dev-server-core/test-helpers' ;
3+ import {
4+ createTestServer ,
5+ fetchText ,
6+ expectIncludes ,
7+ expectNotIncludes ,
8+ } from '@web/dev-server-core/test-helpers' ;
49import { posix as pathUtil } from 'path' ;
510
611import { hmrPlugin } from '../dist/index.js' ;
@@ -353,7 +358,7 @@ describe('HmrPlugin', () => {
353358 try {
354359 const response = await fetch ( `${ host } ${ NAME_HMR_CLIENT_IMPORT } ` ) ;
355360 const body = await response . text ( ) ;
356- assert . ok ( body . includes ( 'class HotModule' ) ) ;
361+ expectIncludes ( body , 'class HotModule' ) ;
357362 } finally {
358363 await server . stop ( ) ;
359364 }
@@ -377,7 +382,7 @@ describe('HmrPlugin', () => {
377382 const response = await fetch ( `${ host } /foo.js` ) ;
378383 const body = await response . text ( ) ;
379384
380- assert . ok ( body . includes ( '__WDS_HMR__' ) ) ;
385+ expectIncludes ( body , '__WDS_HMR__' ) ;
381386 } finally {
382387 await server . stop ( ) ;
383388 }
@@ -393,7 +398,7 @@ describe('HmrPlugin', () => {
393398 const response = await fetch ( `${ host } /foo.js` ) ;
394399 const body = await response . text ( ) ;
395400
396- assert . ok ( ! body . includes ( '__WDS_HMR__' ) ) ;
401+ expectNotIncludes ( body , '__WDS_HMR__' ) ;
397402 } finally {
398403 await server . stop ( ) ;
399404 }
0 commit comments