Skip to content

Commit

Permalink
fix: don't use import assertions to ensure compatibility with Node 14…
Browse files Browse the repository at this point in the history
… and 16 in the test runner
  • Loading branch information
wessberg committed May 29, 2022
1 parent 78592d0 commit d9c996e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/util/ts-macro.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import semver from "semver";
import pkg from "../../package.json" assert {type: "json"};
import fs from "fs";
import path from "crosspath";
import type {ExecutionContext, OneOrMoreMacros, Macro} from "ava";
import type {TS} from "../../src/type/ts.js";

const currentFile = import.meta.url.replace(/file:\/{2,3}/, "");
const currentDir = path.dirname(currentFile);
const pkg = JSON.parse(fs.readFileSync(path.join(currentDir, "../../package.json"), "utf-8"));

// ava macros
export interface ExtendedImplementationArgumentOptions {
typescript: typeof TS;
Expand Down

0 comments on commit d9c996e

Please sign in to comment.