From 329b6f8275035bb1ff29b7445559a488dfc8b2ec Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Wed, 14 Feb 2024 13:21:54 +0100 Subject: [PATCH] test: refactor to use named configs --- test/fixture/.base/{config.jsonc => test.config.jsonc} | 0 test/fixture/{.configrc => .testrc} | 0 test/fixture/_github/package.json | 2 +- test/fixture/_github/{config.ts => test.config.ts} | 0 test/fixture/node_modules/c12-npm-test/package.json | 2 +- .../node_modules/c12-npm-test/{config.ts => test.config.ts} | 0 test/fixture/{config.dev.ts => test.config.dev.ts} | 0 test/fixture/{config.ts => test.config.ts} | 2 +- test/fixture/theme/{config.json5 => test.config.json5} | 0 test/index.test.ts | 3 +++ 10 files changed, 6 insertions(+), 3 deletions(-) rename test/fixture/.base/{config.jsonc => test.config.jsonc} (100%) rename test/fixture/{.configrc => .testrc} (100%) rename test/fixture/_github/{config.ts => test.config.ts} (100%) rename test/fixture/node_modules/c12-npm-test/{config.ts => test.config.ts} (100%) rename test/fixture/{config.dev.ts => test.config.dev.ts} (100%) rename test/fixture/{config.ts => test.config.ts} (89%) rename test/fixture/theme/{config.json5 => test.config.json5} (100%) diff --git a/test/fixture/.base/config.jsonc b/test/fixture/.base/test.config.jsonc similarity index 100% rename from test/fixture/.base/config.jsonc rename to test/fixture/.base/test.config.jsonc diff --git a/test/fixture/.configrc b/test/fixture/.testrc similarity index 100% rename from test/fixture/.configrc rename to test/fixture/.testrc diff --git a/test/fixture/_github/package.json b/test/fixture/_github/package.json index 646867d..da53ba7 100644 --- a/test/fixture/_github/package.json +++ b/test/fixture/_github/package.json @@ -2,6 +2,6 @@ "name": "c12-github-layer", "version": "0.0.0", "exports": { - ".": "./config.ts" + ".": "./test.config.ts" } } diff --git a/test/fixture/_github/config.ts b/test/fixture/_github/test.config.ts similarity index 100% rename from test/fixture/_github/config.ts rename to test/fixture/_github/test.config.ts diff --git a/test/fixture/node_modules/c12-npm-test/package.json b/test/fixture/node_modules/c12-npm-test/package.json index 50e4bdc..7d8552b 100644 --- a/test/fixture/node_modules/c12-npm-test/package.json +++ b/test/fixture/node_modules/c12-npm-test/package.json @@ -2,6 +2,6 @@ "name": "c12-npm-test", "version": "0.0.0", "exports": { - ".": "./config.ts" + ".": "./test.config.ts" } } diff --git a/test/fixture/node_modules/c12-npm-test/config.ts b/test/fixture/node_modules/c12-npm-test/test.config.ts similarity index 100% rename from test/fixture/node_modules/c12-npm-test/config.ts rename to test/fixture/node_modules/c12-npm-test/test.config.ts diff --git a/test/fixture/config.dev.ts b/test/fixture/test.config.dev.ts similarity index 100% rename from test/fixture/config.dev.ts rename to test/fixture/test.config.dev.ts diff --git a/test/fixture/config.ts b/test/fixture/test.config.ts similarity index 89% rename from test/fixture/config.ts rename to test/fixture/test.config.ts index cf59f29..1184dc8 100644 --- a/test/fixture/config.ts +++ b/test/fixture/test.config.ts @@ -5,7 +5,7 @@ export default { ["gh:unjs/c12/test/fixture/_github#main", { giget: {} }], ], $test: { - extends: ["./config.dev"], + extends: ["./test.config.dev"], envConfig: true, }, colors: { diff --git a/test/fixture/theme/config.json5 b/test/fixture/theme/test.config.json5 similarity index 100% rename from test/fixture/theme/config.json5 rename to test/fixture/theme/test.config.json5 diff --git a/test/index.test.ts b/test/index.test.ts index 395edda..df58e49 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -19,6 +19,7 @@ describe("c12", () => { }>; const { config, layers } = await loadConfig({ cwd: r("./fixture"), + name: "test", dotenv: true, packageJson: ["c12", "c12-alt"], globalRc: true, @@ -218,6 +219,7 @@ describe("c12", () => { it("extend from git repo", async () => { const { config } = await loadConfig({ + name: "test", cwd: r("./fixture/new_dir"), overrides: { extends: ["github:unjs/c12/test/fixture"], @@ -251,6 +253,7 @@ describe("c12", () => { it("omit$Keys", async () => { const { config, layers } = await loadConfig({ + name: "test", cwd: r("./fixture"), envName: "test", omit$Keys: true,