1+ import { describe , it } from 'node:test' ;
12import path from 'path' ;
23import { runTests } from '@web/test-runner-core/test-helpers' ;
34import { chromeLauncher } from '@web/test-runner-chrome' ;
45import { playwrightLauncher } from '@web/test-runner-playwright' ;
56
6- import { emulateMediaPlugin } from '../../src/emulateMediaPlugin.js' ;
7-
8- describe ( 'emulateMediaPlugin' , function test ( ) {
9- this . timeout ( 20000 ) ;
7+ import { emulateMediaPlugin } from '../../dist/emulateMediaPlugin.js' ;
108
9+ describe ( 'emulateMediaPlugin' , { timeout : 20000 } , ( ) => {
1110 it ( 'can emulate media on puppeteer' , async ( ) => {
1211 await runTests ( {
1312 files : [
14- path . join ( __dirname , 'browser-test.js' ) ,
15- path . join ( __dirname , 'prefers-reduced-motion-test.js' ) ,
13+ path . join ( import . meta . dirname , 'browser-test.js' ) ,
14+ path . join ( import . meta . dirname , 'prefers-reduced-motion-test.js' ) ,
1615 ] ,
1716
1817 browsers : [ chromeLauncher ( ) ] ,
@@ -23,8 +22,8 @@ describe('emulateMediaPlugin', function test() {
2322 it ( 'can emulate media on playwright' , async ( ) => {
2423 await runTests ( {
2524 files : [
26- path . join ( __dirname , 'browser-test.js' ) ,
27- path . join ( __dirname , 'prefers-reduced-motion-test.js' ) ,
25+ path . join ( import . meta . dirname , 'browser-test.js' ) ,
26+ path . join ( import . meta . dirname , 'prefers-reduced-motion-test.js' ) ,
2827 ] ,
2928 browsers : [
3029 playwrightLauncher ( { product : 'chromium' } ) ,
@@ -37,7 +36,7 @@ describe('emulateMediaPlugin', function test() {
3736
3837 it ( 'can emulate forced-colors on playwright, except webkit' , async ( ) => {
3938 await runTests ( {
40- files : [ path . join ( __dirname , 'forced-colors-test.js' ) ] ,
39+ files : [ path . join ( import . meta . dirname , 'forced-colors-test.js' ) ] ,
4140 browsers : [
4241 playwrightLauncher ( { product : 'chromium' } ) ,
4342 playwrightLauncher ( { product : 'firefox' } ) ,
0 commit comments