Skip to content

Commit 6e68d76

Browse files
committed
switch to vitest, deprecate support for node v18
1 parent 75aaeba commit 6e68d76

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828
matrix:
2929
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
3030
node-version:
31-
- "18"
3231
- "20"
3332
- "22"
3433
- "24"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ I've been adding load tests to the unit tests in various places. Generally speak
5151

5252
We run GitHUB CI on the following:
5353

54-
- nodejs versions 18, 20, 22, and 24
54+
- nodejs versions 20, 22, and 24
5555

5656
**Development:**
5757

lib/test/http/empty-req-url.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import express from "express";
22
import getPort from "../get-port";
33
import ProxyServer, { createServer } from "../..";
44
import http from "node:http";
5+
import { describe, it, expect } from "vitest";
56

67
describe("test empty req.url", () => {
78
let port: number, server: http.Server;
@@ -27,7 +28,7 @@ describe("test empty req.url", () => {
2728
res.end("Something went wrong.");
2829
});
2930
httpServer = http.createServer((req, res) => {
30-
req.url = '' + new URL(`http://example.com${req.url}`).search;
31+
req.url = "" + new URL(`http://example.com${req.url}`).search;
3132
proxy.web(req, res, { target: `http://localhost:${port}/test` });
3233
});
3334

@@ -41,8 +42,8 @@ describe("test empty req.url", () => {
4142

4243
it("get using the proxy", async () => {
4344
expect(await getProxy("")).toBe("Test Page!: {}");
44-
expect(await getProxy("?foo")).toBe("Test Page!: {\"foo\":\"\"}");
45-
expect(await getProxy("?foo=bar")).toBe("Test Page!: {\"foo\":\"bar\"}");
45+
expect(await getProxy("?foo")).toBe('Test Page!: {"foo":""}');
46+
expect(await getProxy("?foo=bar")).toBe('Test Page!: {"foo":"bar"}');
4647
});
4748

4849
it("clean up", () => {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "http-proxy-3",
3-
"version": "1.20.14",
3+
"version": "1.20.15",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/sagemathinc/http-proxy-3.git"
@@ -56,7 +56,7 @@
5656
"scripts": {
5757
"test": "NODE_TLS_REJECT_UNAUTHORIZED=0 pnpm exec vitest run",
5858
"test-all": "pnpm audit && TEST_EXTERNAL_REVERSE_PROXY=yes pnpm test --pool threads --poolOptions.threads.singleThread",
59-
"test-versions": ". \"$NVM_DIR/nvm.sh\" && nvm use 18 && pnpm test && nvm use 20 && pnpm test && nvm use 22 && pnpm test && nvm use 24 && pnpm test && nvm use 20",
59+
"test-versions": "bash -c '. \"$NVM_DIR/nvm.sh\" && nvm use 20 && pnpm test && nvm use 22 && pnpm test && nvm use 24 && pnpm test'",
6060
"clean": "rm -rf dist node_modules",
6161
"build": "pnpm exec tsc --build",
6262
"make": "pnpm clean && pnpm install && pnpm build && pnpm test",

0 commit comments

Comments
 (0)