1- const path = require ( 'path' )
2- const test = require ( 'tape' )
3- const crossSpawn = require ( 'cross-spawn' )
1+ import { fileURLToPath } from 'node:url'
2+ import test from 'tape'
3+ import crossSpawn from 'cross-spawn'
44
5- const CMD_PATH = path . join ( __dirname , '..' , ' bin' , ' cmd.js')
5+ const CMD_PATH = fileURLToPath ( new URL ( '../ bin/ cmd.js' , import . meta . url ) )
66
77test ( 'command line usage: --help' , function ( t ) {
88 t . plan ( 2 )
@@ -16,7 +16,7 @@ test('command line usage: --help', function (t) {
1616test ( 'test-repo-eslintrc allows snake_case' , function ( t ) {
1717 t . plan ( 4 )
1818
19- const jsPath = path . join ( __dirname , ' test-repo-eslintrc' , ' index.js')
19+ const jsPath = fileURLToPath ( new URL ( './ test-repo-eslintrc/ index.js', import . meta . url ) )
2020 const result = crossSpawn . sync ( CMD_PATH , [ jsPath ] )
2121
2222 t . error ( result . error )
@@ -29,7 +29,7 @@ test('test-repo-eslintrc allows snake_case', function (t) {
2929test ( 'test-repo-package-json allows snake_case' , function ( t ) {
3030 t . plan ( 4 )
3131
32- const jsPath = path . join ( __dirname , ' test-repo-package-json' , ' index.js')
32+ const jsPath = fileURLToPath ( new URL ( './ test-repo-package-json/ index.js', import . meta . url ) )
3333 const result = crossSpawn . sync ( CMD_PATH , [ jsPath ] )
3434
3535 t . error ( result . error )
0 commit comments