@yeger/vitest-utils 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/config.ts"],"sourcesContent":["import process from 'node:process'\nimport type { TestUserConfig } from 'vitest/config'\nimport type { BrowserProviderOption } from 'vitest/node'\nimport deepmerge from '
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/config.ts"],"sourcesContent":["import process from 'node:process'\nimport type { TestUserConfig } from 'vitest/config'\nimport type { BrowserProviderOption } from 'vitest/node'\nimport deepmerge from 'deepmerge'\n\nexport const configuration: Record<string, TestUserConfig> = {\n common: {\n silent: 'passed-only',\n },\n coverage: {\n coverage: {\n enabled: !!process.env.COVERAGE,\n include: ['src/**/*.*'],\n exclude: ['*.d.ts', '*.ohm', '.gitignore'],\n provider: 'v8' as const,\n },\n },\n idempotent: {\n clearMocks: true,\n mockReset: true,\n restoreMocks: true,\n unstubEnvs: true,\n unstubGlobals: true,\n },\n}\n\nexport interface ConfigurationOptions {\n /**\n * Enables common configuration options. Default: `true`\n */\n common?: boolean\n /**\n * Enable coverage configuration. Default: `true`\n */\n coverage?: boolean\n /**\n * Enable idempotent configuration. Default: `true`\n */\n idempotent?: boolean\n /**\n * Specify the browser provider option. If defined, the browser mode will be auto-configured.\n */\n browser?: BrowserProviderOption\n}\n\n/**\n * Define a Vitest test configuration with coverage, idempotent settings, and browser support.\n */\nexport function defineTestConfig(\n { common = true, coverage = true, idempotent = true, browser }: ConfigurationOptions = {},\n userConfig: TestUserConfig = {},\n): TestUserConfig {\n const config: TestUserConfig = {}\n\n if (common) {\n Object.assign(config, configuration.common)\n }\n\n if (coverage) {\n Object.assign(config, configuration.coverage)\n }\n\n if (idempotent) {\n Object.assign(config, configuration.idempotent)\n }\n\n if (browser) {\n config.browser = {\n enabled: true,\n provider: browser,\n instances: [{ browser: 'chromium' }],\n }\n }\n\n return deepmerge(config, userConfig) as TestUserConfig\n}\n"],"mappings":";;;;AAKA,MAAa,gBAAgD;CAC3D,QAAQ,EACN,QAAQ,eACT;CACD,UAAU,EACR,UAAU;EACR,SAAS,CAAC,CAAC,QAAQ,IAAI;EACvB,SAAS,CAAC,aAAa;EACvB,SAAS;GAAC;GAAU;GAAS;GAAa;EAC1C,UAAU;EACX,EACF;CACD,YAAY;EACV,YAAY;EACZ,WAAW;EACX,cAAc;EACd,YAAY;EACZ,eAAe;EAChB;CACF;;;;AAwBD,SAAgB,iBACd,EAAE,SAAS,MAAM,WAAW,MAAM,aAAa,MAAM,YAAkC,EAAE,EACzF,aAA6B,EAAE,EACf;CAChB,MAAM,SAAyB,EAAE;AAEjC,KAAI,OACF,QAAO,OAAO,QAAQ,cAAc,OAAO;AAG7C,KAAI,SACF,QAAO,OAAO,QAAQ,cAAc,SAAS;AAG/C,KAAI,WACF,QAAO,OAAO,QAAQ,cAAc,WAAW;AAGjD,KAAI,QACF,QAAO,UAAU;EACf,SAAS;EACT,UAAU;EACV,WAAW,CAAC,EAAE,SAAS,YAAY,CAAC;EACrC;AAGH,QAAO,UAAU,QAAQ,WAAW"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yeger/vitest-utils",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"bugs": {
|
|
5
5
|
"url": "https://github.com/DerYeger/yeger/issues"
|
|
6
6
|
},
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"
|
|
35
|
+
"deepmerge": "4.3.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"publint": "0.3.17",
|