Skip to content

Commit c760b8a

Browse files
benmccanngtm-nayandummdidumm
committed
chore: fix broken script for generating parser tests (#8945)
--------- Co-authored-by: gtmnayan <[email protected]> Co-authored-by: Simon H <[email protected]>
1 parent 986626e commit c760b8a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/svelte/test/parser/update.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22
// equivalents. Only use it when you're sure that you haven't
33
// broken anything!
44
import * as fs from 'node:fs';
5+
import { dirname } from 'node:path';
6+
import { fileURLToPath } from 'node:url';
57
import glob from 'tiny-glob/sync.js';
68

9+
const __dirname = dirname(fileURLToPath(import.meta.url));
10+
711
glob('samples/*/_actual.json', { cwd: __dirname }).forEach((file) => {
812
const actual = fs.readFileSync(`${__dirname}/${file}`, 'utf-8');
913
fs.writeFileSync(`${__dirname}/${file.replace('_actual.json', 'output.json')}`, actual);

0 commit comments

Comments
 (0)