Skip to content

Commit 63311bd

Browse files
committed
esm tests
Signed-off-by: Sora Morimoto <[email protected]>
1 parent 11c5089 commit 63311bd

File tree

38 files changed

+38
-38
lines changed

38 files changed

+38
-38
lines changed

tests/spec/additional-properties-2.0/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("additional properties 2.0", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
addReadonly: true,

tests/spec/another-array-type/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--another-array-type", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
anotherArrayType: true,

tests/spec/another-query-params/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("another-query-params", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
generateClient: true,

tests/spec/axios/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--axios option", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
generateClient: true,

tests/spec/axiosSingleHttpClient/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--axios --single-http-client", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
generateClient: true,

tests/spec/const-keyword/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("const-keyword", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
addReadonly: true,

tests/spec/custom-extensions/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("custom extensions", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
});

tests/spec/defaultAsSuccess/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--default-as-success", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
defaultResponseAsSuccess: true,

tests/spec/defaultResponse/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--default-response", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
defaultResponseType: "unknown",

tests/spec/deprecated/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("@deprecated", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
queryParamsWithBrackets: true,

tests/spec/discriminator/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("discriminator", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
addReadonly: true,

tests/spec/dot-path-params/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--dot-path-params", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
generateClient: true,

tests/spec/enumNamesAsValues/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--enum-names-as-values", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
enumNamesAsValues: true,

tests/spec/enums-2.0/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("enums-2.0", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
extractRequestParams: true,

tests/spec/extractRequestBody/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--extract-request-body", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
extractRequestBody: true,

tests/spec/extractRequestParams/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--extract-request-params", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
extractRequestParams: true,

tests/spec/extractResponseBody/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--extract-response-body", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
extractResponseBody: true,

tests/spec/extractResponseError/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--extract-response-body", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
extractResponseError: true,

tests/spec/js/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--js --axios", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
httpClientType: "axios",

tests/spec/jsAxios/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--js", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
toJS: true,

tests/spec/moduleNameFirstTag/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--module-name-first-tag", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
moduleNameFirstTag: true,

tests/spec/moduleNameIndex/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--module-name-index", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
moduleNameIndex: 2,

tests/spec/noClient/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--no-client", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
generateClient: false,

tests/spec/nullable-2.0/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("nullable-2.0 refs", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
addReadonly: true,

tests/spec/nullable-3.0/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("nullable-3.0 refs", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
addReadonly: true,

tests/spec/object-types/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("object-types", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
addReadonly: true,

tests/spec/on-insert-path-param/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("on-insert-path-param", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
generateClient: true,

tests/spec/patch/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--patch", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
patch: true,

tests/spec/readonly/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("readonly", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
addReadonly: true,

tests/spec/responses/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("responses", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
generateResponses: true,

tests/spec/routeTypes/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--route-types", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
generateClient: false,

tests/spec/singleHttpClient/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--single-http-client", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
singleHttpClient: true,

tests/spec/sortTypes-false/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--sort-types=false", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
generateClient: true,

tests/spec/sortTypes/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--sort-types", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
generateClient: true,

tests/spec/specProperty/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("specProperty", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
generateClient: false,

tests/spec/typeSuffixPrefix/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--type-prefix and --type-suffix", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
generateClient: true,

tests/spec/unionEnums/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("basic", async () => {
2020
test("--union-enums", async () => {
2121
await generateApi({
2222
name: "schema",
23-
input: path.resolve(__dirname, "schema.json"),
23+
input: path.resolve(import.meta.dirname, "schema.json"),
2424
output: tmpdir,
2525
silent: true,
2626
generateUnionEnums: true,

tests/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as path from "node:path";
33

44
export async function collectAllSchemas() {
55
const schemas = [];
6-
const schemaPath = path.join(__dirname, "fixtures", "schemas");
6+
const schemaPath = path.join(import.meta.dirname, "fixtures", "schemas");
77
const schemaFiles = await fs.readdir(schemaPath, { recursive: true });
88
for (const schemaFile of schemaFiles) {
99
if (

0 commit comments

Comments
 (0)