Skip to content

Commit b6faa4f

Browse files
Copilotkobenguyent
andcommitted
Fix test-server.js: Complete ESM conversion (export and CLI check)
Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
1 parent d6bd797 commit b6faa4f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/test-server.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,10 @@ class TestServer {
297297
}
298298
}
299299

300-
module.exports = TestServer
300+
export default TestServer
301301

302-
// CLI usage
303-
if (require.main === module) {
302+
// CLI usage - check if this module is being run directly
303+
if (import.meta.url === `file://${process.argv[1]}`) {
304304
const config = {
305305
port: process.env.PORT || 8010,
306306
host: process.env.HOST || '0.0.0.0',

0 commit comments

Comments
 (0)