Skip to content

Commit 6548914

Browse files
committed
fix: tests to align with new esm format
1 parent 7970eaf commit 6548914

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

integration-test.js renamed to integration-test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import SimpleMathClient from "./generated/client/typescript/build/index.js";
12
console.log("Running client test");
2-
const SimpleMathClient = require("./generated/client/typescript/build").default;
33
console.log("imported client: ", SimpleMathClient);
44

55
const client = new SimpleMathClient({

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"start": "npm run build && ./build/cli.js",
2121
"test": "npm run test:lint && npm run test:unit && npm run test:integration",
2222
"lint": "eslint 'src/**/*.{ts,tsx}'",
23-
"test:unit": "jest --coverage",
24-
"test:integration": "npm run build && ./build/cli.js generate -c test-generator-config.json && ((cd ./generated/server/typescript/ && npm install && npm start) & (cd ./generated/client/typescript && npm install && npm run build && cd - && sleep 15 && node ./integration-test.js))",
23+
"test:unit": "NODE_OPTIONS=--experimental-vm-modules jest --coverage",
24+
"test:integration": "npm run build && ./build/cli.js generate -c test-generator-config.json && ((cd ./generated/server/typescript/ && npm install && npm start) & (cd ./generated/client/typescript && npm install && npm run build && cd - && sleep 15 && node ./integration-test.mjs))",
2525
"build": "npm run build:clean && tsc && chmod +x build/cli.js",
2626
"build:clean": "rm -rf build",
2727
"watch:build": "tsc --watch",
@@ -57,4 +57,4 @@
5757
"ts-jest": "^29.1.2",
5858
"typescript": "^4.9.5"
5959
}
60-
}
60+
}

src/index.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ describe(`Examples to generate Js clients`, () => {
6262

6363
return expect(genProm).rejects.toBeInstanceOf(OpenRPCDocumentDereferencingError);
6464
});
65-
6665
forEach(examples, (example: OpenRPC, exampleName: string) => {
6766
it(`rejects configurations without outDir or outPath`, async () => {
6867
const promGen = clientGen({

0 commit comments

Comments
 (0)