From b6d5e2d6b1c2523ba9aa9b81ebe64d63dea86a28 Mon Sep 17 00:00:00 2001 From: Robin Tail Date: Tue, 19 Dec 2023 17:27:22 +0100 Subject: [PATCH] Removing ts-node in favor of tsx, ensure CJS/ESM by file extension. --- test/{index.ts => index.cts} | 0 test/index.mts | 8 ++++++++ test/package.json | 9 ++++----- 3 files changed, 12 insertions(+), 5 deletions(-) rename test/{index.ts => index.cts} (100%) create mode 100644 test/index.mts diff --git a/test/index.ts b/test/index.cts similarity index 100% rename from test/index.ts rename to test/index.cts diff --git a/test/index.mts b/test/index.mts new file mode 100644 index 0000000..5a796c4 --- /dev/null +++ b/test/index.mts @@ -0,0 +1,8 @@ +import assert from 'node:assert'; +import { oas31 } from 'openapi3-ts'; +import { OpenApiBuilder } from 'openapi3-ts/oas31'; + +const builder1 = new oas31.OpenApiBuilder(); +assert.ok(typeof builder1.rootDoc === 'object'); +const builder2 = new OpenApiBuilder(); +assert.ok(typeof builder2.rootDoc === 'object'); diff --git a/test/package.json b/test/package.json index ac8fe23..ddaf9be 100644 --- a/test/package.json +++ b/test/package.json @@ -5,16 +5,15 @@ "scripts": { "test:cjs": "node index.cjs", "test:mjs": "node index.mjs", - "test:ts": "ts-node --project fixture/tsconfig.node.json index.ts", - "test:ts-esm": "tsx --tsconfig fixture/tsconfig.node.json index.ts", - "test:ts-node16": "ts-node --project fixture/tsconfig.node16.json index.ts", - "test:ts-esm-node16": "tsx --tsconfig fixture/tsconfig.node16.json index.ts" + "test:ts": "tsx --tsconfig fixture/tsconfig.node.json index.cts", + "test:ts-esm": "tsx --tsconfig fixture/tsconfig.node.json index.mts", + "test:ts-node16": "tsx --tsconfig fixture/tsconfig.node16.json index.cts", + "test:ts-esm-node16": "tsx --tsconfig fixture/tsconfig.node16.json index.mts" }, "dependencies": { "openapi3-ts": "file:.." }, "devDependencies": { - "ts-node": "^10.9.1", "tsx": "^4.6.2" } }