@stencil/vitest 1.1.7 → 1.1.8
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/bin/stencil-test.js +11 -4
- package/package.json +2 -2
package/dist/bin/stencil-test.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { spawn } from 'child_process';
|
|
3
3
|
import { existsSync, unlinkSync, writeFileSync } from 'fs';
|
|
4
|
-
import { join } from 'path';
|
|
4
|
+
import { extname, join } from 'path';
|
|
5
5
|
import { createJiti } from 'jiti';
|
|
6
6
|
function parseArgs(argv) {
|
|
7
7
|
const parsed = {
|
|
@@ -388,15 +388,22 @@ async function createTemporaryStencilConfig(userSpecifiedConfig, vitestConfigPat
|
|
|
388
388
|
};
|
|
389
389
|
// Create temp file as sibling of stencil.config so tsconfig.json can be found
|
|
390
390
|
// Stencil looks for tsconfig.json relative to the config file location
|
|
391
|
-
const
|
|
391
|
+
const ext = extname(userConfigPath);
|
|
392
|
+
const tempConfigPath = join(cwd, `.stencil-test-${Date.now()}.config${ext}`);
|
|
392
393
|
// Serialize the config - convert RegExp objects to strings for the output
|
|
393
394
|
const patternsArray = mergedConfig.watchIgnoredRegex.map((pattern) => pattern.toString()).join(',\n ');
|
|
394
|
-
|
|
395
|
+
/**
|
|
396
|
+
* Generate a simple config with user config import.
|
|
397
|
+
*
|
|
398
|
+
* JSON.stringify for normalize path between windows and unix.
|
|
399
|
+
* Windows: "C:\xxx\yyy" -> "C:\\xxx\\yyy"
|
|
400
|
+
* Unix: "C:/xxx/yyy" -> "C:/xxx/yyy"
|
|
401
|
+
*/
|
|
395
402
|
const tempConfigContent = `
|
|
396
403
|
// Auto-generated temporary config by stencil-test
|
|
397
404
|
// This extends your stencil config and adds watchIgnoredRegex for screenshot files
|
|
398
405
|
|
|
399
|
-
import ${userConfig.config ? '{ config as baseConfig }' : 'baseConfig'} from
|
|
406
|
+
import ${userConfig.config ? '{ config as baseConfig }' : 'baseConfig'} from ${JSON.stringify(userConfigPath)};
|
|
400
407
|
|
|
401
408
|
export const config = {
|
|
402
409
|
...baseConfig,
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "https://github.com/stenciljs/vitest"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.1.
|
|
7
|
+
"version": "1.1.8",
|
|
8
8
|
"description": "First-class testing utilities for Stencil design systems with Vitest",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"type": "module",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"jiti": "^2.6.1",
|
|
94
94
|
"local-pkg": "^1.1.2",
|
|
95
|
-
"vitest-environment-stencil": "1.1.
|
|
95
|
+
"vitest-environment-stencil": "1.1.8"
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
98
|
"@eslint/js": "^9.39.2",
|