Skip to content

Commit 20cd927

Browse files
Copilotkobenguyent
andcommitted
Fix __dirname usage in test-server.js and testcafe-utils.js
Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
1 parent b6faa4f commit 20cd927

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

lib/helper/testcafe/testcafe-utils.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import assert from 'assert'
44
import fs from 'fs'
55
import path from 'path'
66
import { getParamNames } from '../../utils.js'
7+
import { fileURLToPath } from 'url'
8+
import { dirname } from 'path'
9+
10+
const __filename = fileURLToPath(import.meta.url)
11+
const __dirname = dirname(__filename)
712

813
const createTestFile = () => {
914
assert(global.output_dir, 'global.output_dir must be set')

lib/test-server.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import express from 'express'
22
import fs from 'fs'
33
import path from 'path'
4+
import { fileURLToPath } from 'url'
5+
import { dirname } from 'path'
6+
7+
const __filename = fileURLToPath(import.meta.url)
8+
const __dirname = dirname(__filename)
49

510
/**
611
* Internal API test server to replace json-server dependency

0 commit comments

Comments
 (0)