From 593619a6927d07bb0c5599d5fc314dd75dee4cee Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Wed, 14 Feb 2024 13:25:18 +0100 Subject: [PATCH] test: update tests --- .configrc => .testrc | 0 test/index.test.ts | 40 ++++++++++++++++++++-------------------- 2 files changed, 20 insertions(+), 20 deletions(-) rename .configrc => .testrc (100%) diff --git a/.configrc b/.testrc similarity index 100% rename from .configrc rename to .testrc diff --git a/test/index.test.ts b/test/index.test.ts index df58e49..d1c1da5 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -53,7 +53,7 @@ describe("c12", () => { "$test": { "envConfig": true, "extends": [ - "./config.dev", + "./test.config.dev", ], }, "array": [ @@ -94,7 +94,7 @@ describe("c12", () => { "$test": { "envConfig": true, "extends": [ - "./config.dev", + "./test.config.dev", ], }, "array": [ @@ -106,7 +106,7 @@ describe("c12", () => { "configFile": true, "envConfig": true, "extends": [ - "./config.dev", + "./test.config.dev", [ "c12-npm-test", ], @@ -120,7 +120,7 @@ describe("c12", () => { "overriden": false, "theme": "./theme", }, - "configFile": "config", + "configFile": "test.config", "cwd": "/fixture", }, { @@ -128,7 +128,7 @@ describe("c12", () => { "rcFile": true, "testConfig": true, }, - "configFile": ".configrc", + "configFile": ".testrc", }, { "config": { @@ -144,10 +144,10 @@ describe("c12", () => { "secondary": "theme_secondary", }, }, - "configFile": "/fixture/theme/config.json5", + "configFile": "/fixture/theme/test.config.json5", "cwd": "/fixture/theme", "meta": {}, - "source": "config", + "source": "test.config", "sourceOptions": {}, }, { @@ -167,43 +167,43 @@ describe("c12", () => { "text": "base_text", }, }, - "configFile": "/fixture/.base/config.jsonc", + "configFile": "/fixture/.base/test.config.jsonc", "cwd": "/fixture/.base", "meta": { "name": "base", "version": "1.0.0", }, - "source": "config", + "source": "test.config", "sourceOptions": {}, }, { "config": { "devConfig": true, }, - "configFile": "/fixture/config.dev.ts", + "configFile": "/fixture/test.config.dev.ts", "cwd": "/fixture", "meta": {}, - "source": "./config.dev", + "source": "./test.config.dev", "sourceOptions": {}, }, { "config": { "npmConfig": true, }, - "configFile": "/fixture/node_modules/c12-npm-test/config.ts", + "configFile": "/fixture/node_modules/c12-npm-test/test.config.ts", "cwd": "/fixture/node_modules/c12-npm-test", "meta": {}, - "source": "/fixture/node_modules/c12-npm-test/config.ts", + "source": "/fixture/node_modules/c12-npm-test/test.config.ts", "sourceOptions": {}, }, { "config": { "githubLayer": true, }, - "configFile": "/fixture/node_modules/.c12/gh_unjs_c12_vsPD2sVEDo/config.ts", + "configFile": "/fixture/node_modules/.c12/gh_unjs_c12_vsPD2sVEDo/test.config.ts", "cwd": "/fixture/node_modules/.c12/gh_unjs_c12_vsPD2sVEDo", "meta": {}, - "source": "config", + "source": "test.config", "sourceOptions": { "giget": {}, }, @@ -231,7 +231,7 @@ describe("c12", () => { "$test": { "envConfig": true, "extends": [ - "./config.dev", + "./test.config.dev", ], }, "array": [ @@ -274,13 +274,13 @@ describe("c12", () => { >[]; const configLayer = transformdLayers.find( - (layer) => layer.configFile === "config", + (layer) => layer.configFile === "test.config", )!; expect(Object.keys(configLayer.config!)).toContain("$test"); - const baseConfigLay = transformdLayers.find( - (layer) => layer.configFile === "/fixture/.base/config.jsonc", + const baseLayerConfig = transformdLayers.find( + (layer) => layer.configFile === "/fixture/.base/test.config.jsonc", )!; - expect(Object.keys(baseConfigLay.config!)).toContain("$env"); + expect(Object.keys(baseLayerConfig.config!)).toContain("$env"); }); });