Skip to content

Commit ebcdd6d

Browse files
committed
No monkey patching
1 parent 2545889 commit ebcdd6d

5 files changed

Lines changed: 385 additions & 387 deletions

File tree

packages/mrt-utilities/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@
7979
"pretest": "tsc --noEmit -p test",
8080
"test": "c8 mocha --forbid-only \"test/**/*.test.ts\"",
8181
"test:agent": "mocha --forbid-only --reporter min \"test/**/*.test.ts\"",
82-
"test:express5": "pnpm run test",
83-
"test:express4": "NODE_OPTIONS=\"--require ./test/helpers/express4-alias.cjs\" pnpm run test",
84-
"test:express:matrix": "pnpm run test:express5 && pnpm run test:express4",
8582
"test:watch": "mocha --watch \"test/**/*.test.ts\""
8683
},
8784
"dependencies": {
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright (c) 2025, Salesforce, Inc.
3+
* SPDX-License-Identifier: Apache-2
4+
* For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
5+
*/
6+
7+
import express5 from 'express';
8+
import {createRequire} from 'node:module';
9+
10+
/*
11+
* Load Express v4 via an npm alias so tests can run against v4 and v5
12+
* in the same process without altering production imports.
13+
*/
14+
const require = createRequire(import.meta.url);
15+
const express4 = require('express4') as typeof express5;
16+
17+
/*
18+
* Export both versions for parameterized test suites.
19+
*/
20+
export const expressVersions = [
21+
{label: 'express4', express: express4},
22+
{label: 'express5', express: express5},
23+
];

packages/mrt-utilities/test/helpers/express4-alias.cjs

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)