Skip to content

Commit c264148

Browse files
committed
feat(esm): Convert bin/test-server.js to ESM
Added __dirname polyfills and import statements. bin/codecept.js was already using ESM.
1 parent 7e7987a commit c264148

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

bin/test-server.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@
44
* Standalone test server script to replace json-server
55
*/
66

7-
const path = require('path')
8-
const TestServer = require('../lib/test-server')
7+
import path from 'path'
8+
import { fileURLToPath } from 'url'
9+
import { dirname } from 'path'
10+
import TestServer from '../lib/test-server.js'
11+
12+
const __filename = fileURLToPath(import.meta.url)
13+
const __dirname = dirname(__filename)
914

1015
// Parse command line arguments
1116
const args = process.argv.slice(2)

0 commit comments

Comments
 (0)