diff --git a/packages/svelte/test/parser/update.js b/packages/svelte/test/parser/update.js index 0a33b17535..1ea8734df9 100644 --- a/packages/svelte/test/parser/update.js +++ b/packages/svelte/test/parser/update.js @@ -2,8 +2,12 @@ // equivalents. Only use it when you're sure that you haven't // broken anything! import * as fs from 'node:fs'; +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; import glob from 'tiny-glob/sync.js'; +const __dirname = dirname(fileURLToPath(import.meta.url)); + glob('samples/*/_actual.json', { cwd: __dirname }).forEach((file) => { const actual = fs.readFileSync(`${__dirname}/${file}`, 'utf-8'); fs.writeFileSync(`${__dirname}/${file.replace('_actual.json', 'output.json')}`, actual);