diff --git a/package.json b/package.json index 4b88c493..bdbc0c4b 100644 --- a/package.json +++ b/package.json @@ -54,8 +54,8 @@ "prettier-check": "prettier . --check --cache", "prettier-fix": "prettier . --write --cache", "test": "turbo run testing check-engines --continue", - "test-run": "(cd test/ && node ./run.js)", - "test-run-record": "(cd test/ && node ./run.js record)", + "test-run": "(cd test/ && node ./run.mjs)", + "test-run-record": "(cd test/ && node ./run.mjs record)", "tsc": "tsc", "tsc-watch": "tsc --watch" }, diff --git a/test/run.js b/test/run.mjs similarity index 98% rename from test/run.js rename to test/run.mjs index a7c41a91..51606eed 100755 --- a/test/run.js +++ b/test/run.mjs @@ -1,8 +1,12 @@ #!/bin/node /* eslint n/no-process-exit: "off" -- WIP */ -const {execSync} = require('node:child_process'); -const fs = require('node:fs'); -const path = require('node:path'); +import {execSync} from 'node:child_process'; +import * as fs from 'node:fs'; +import * as path from 'node:path'; +import {fileURLToPath} from 'node:url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); const CMD = 'elm-review --no-color'; const TMP = path.join(__dirname, 'temporary');