Skip to content

Commit d9fe89e

Browse files
committed
Don't use Node 21 syntax
1 parent dbf7305 commit d9fe89e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/image/compare_pixels_test.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ import minimist from 'minimist';
33
import path from 'path';
44
import pixelmatch from 'pixelmatch';
55
import { PNG } from 'pngjs';
6+
import { fileURLToPath } from 'url';
67
import common from '../../tasks/util/common.js';
78
import constants from '../../tasks/util/constants.js';
89
import getImagePaths from './assets/get_image_paths.js';
910
import getMockList from './assets/get_mock_list.js';
1011

12+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
13+
1114
fs.mkdirSync(constants.pathToTestImagesDiff, { recursive: true });
1215

1316
/**
@@ -60,7 +63,8 @@ argv._.forEach((pattern) => {
6063

6164
const skipped = new Set();
6265
const failed = new Set();
63-
const disallowListPath = path.join(import.meta.dirname, 'disallow_list.json');
66+
// TODO: In Node 20+, replace with: import disallowListData from './disallow_list.json' with { type: 'json' };
67+
const disallowListPath = path.join(__dirname, 'disallow_list.json');
6468
const disallowList = new Set(JSON.parse(fs.readFileSync(disallowListPath)));
6569
const flakyList = new Set(['gl3d_bunny-hull']);
6670
const flakyListMaps = new Set([

0 commit comments

Comments
 (0)