From 5aa7ed888ddf314fba3c4f8750b891cb6427c9c2 Mon Sep 17 00:00:00 2001 From: Timmy Willison Date: Fri, 8 Mar 2024 18:18:24 -0500 Subject: Build: drop support for Node 10 Close gh-5436 --- test/middleware-mockserver.cjs | 4 ++-- test/runner/createTestServer.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/middleware-mockserver.cjs b/test/middleware-mockserver.cjs index 8a175d6f2..0b513f042 100644 --- a/test/middleware-mockserver.cjs +++ b/test/middleware-mockserver.cjs @@ -1,7 +1,7 @@ "use strict"; -const url = require( "url" ); -const fs = require( "fs" ); +const url = require( "node:url" ); +const fs = require( "node:fs" ); const getRawBody = require( "raw-body" ); const multiparty = require( "multiparty" ); diff --git a/test/runner/createTestServer.js b/test/runner/createTestServer.js index b78fed278..d9ea9e280 100644 --- a/test/runner/createTestServer.js +++ b/test/runner/createTestServer.js @@ -1,12 +1,12 @@ import bodyParser from "body-parser"; import express from "express"; import bodyParserErrorHandler from "express-body-parser-error-handler"; -import fs from "fs"; +import { readFile } from "fs/promises"; import mockServer from "../middleware-mockserver.cjs"; export async function createTestServer( report ) { - const nameHTML = await fs.promises.readFile( "./test/data/name.html", "utf8" ); - const indexHTML = await fs.promises.readFile( "./test/index.html", "utf8" ); + const nameHTML = await readFile( "./test/data/name.html", "utf8" ); + const indexHTML = await readFile( "./test/index.html", "utf8" ); const app = express(); // Redirect home to test page -- cgit v1.2.3