1
0
mirror of https://github.com/morris/vanilla-todo.git synced 2025-08-21 05:11:20 +02:00

modern node imports

This commit is contained in:
Morris Brodersen
2025-02-15 15:31:43 +01:00
parent 94da00f8ff
commit 12b35d447b

View File

@@ -1,8 +1,8 @@
/* global process */ /* global process */
import { test } from '@playwright/test'; import { test } from '@playwright/test';
import { randomUUID } from 'crypto'; import crypto from 'node:crypto';
import { promises as fs } from 'fs'; import fs from 'node:fs';
import * as path from 'path'; import path from 'node:path';
// See also https://playwright.dev/docs/api/class-coverage // See also https://playwright.dev/docs/api/class-coverage
@@ -21,9 +21,12 @@ if (process.env.NODE_V8_COVERAGE) {
})), })),
}; };
await fs.mkdir(process.env.NODE_V8_COVERAGE, { recursive: true }); await fs.promises.mkdir(process.env.NODE_V8_COVERAGE, { recursive: true });
await fs.writeFile( await fs.promises.writeFile(
path.join(process.env.NODE_V8_COVERAGE, `coverage-${randomUUID()}.json`), path.join(
process.env.NODE_V8_COVERAGE,
`coverage-${crypto.randomUUID()}.json`,
),
JSON.stringify(output), JSON.stringify(output),
); );
}); });