@stencil/vitest 1.7.1 → 1.7.2
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.
|
@@ -213,8 +213,8 @@ export default {
|
|
|
213
213
|
writeFileSync(join(testDir, 'vitest.config.ts'), vitestConfig);
|
|
214
214
|
writeFileSync(join(testDir, 'package.json'), JSON.stringify({ name: 'test', type: 'module' }));
|
|
215
215
|
const result = await runCLIInDir(testDir, ['--watch', '--verbose'], 2000);
|
|
216
|
-
// Should add watch ignore patterns (screenshot and
|
|
217
|
-
expect(result.stdout).toMatch(/Added.*screenshot
|
|
216
|
+
// Should add watch ignore patterns (screenshot, test file, and generated file patterns)
|
|
217
|
+
expect(result.stdout).toMatch(/Added.*screenshot.*test file.*generated file patterns/);
|
|
218
218
|
});
|
|
219
219
|
it('should merge user watchIgnoredRegex with screenshot patterns', async () => {
|
|
220
220
|
const stencilConfig = `
|
|
@@ -383,8 +383,8 @@ export default {
|
|
|
383
383
|
writeFileSync(join(testDir, 'vitest.config.ts'), vitestConfig);
|
|
384
384
|
writeFileSync(join(testDir, 'package.json'), JSON.stringify({ name: 'test', type: 'module' }));
|
|
385
385
|
const result = await runCLIInDir(testDir, ['--watch', '--verbose'], 2000);
|
|
386
|
-
// Should report
|
|
387
|
-
expect(result.stdout).toMatch(/Added.*screenshot
|
|
386
|
+
// Should report screenshot, test file, and generated file pattern counts
|
|
387
|
+
expect(result.stdout).toMatch(/Added.*screenshot.*test file.*generated file patterns/);
|
|
388
388
|
});
|
|
389
389
|
});
|
|
390
390
|
describe('temp file cleanup', () => {
|
package/dist/bin/stencil-test.js
CHANGED
|
@@ -449,10 +449,19 @@ async function createTemporaryStencilConfig(userSpecifiedConfig, vitestConfigPat
|
|
|
449
449
|
const userConfig = await jiti.import(userConfigPath);
|
|
450
450
|
// Extract the actual config object
|
|
451
451
|
const actualConfig = userConfig.config || userConfig.default?.config || userConfig.default || userConfig;
|
|
452
|
+
// Patterns for Stencil-generated files that shouldn't trigger rebuilds
|
|
453
|
+
const stencilGeneratedPatterns = [
|
|
454
|
+
/readme\.md$/i, // Stencil generates readme.md files in --prod mode
|
|
455
|
+
];
|
|
452
456
|
// Merge with watchIgnoredRegex
|
|
453
457
|
const mergedConfig = {
|
|
454
458
|
...actualConfig,
|
|
455
|
-
watchIgnoredRegex: [
|
|
459
|
+
watchIgnoredRegex: [
|
|
460
|
+
...(actualConfig?.watchIgnoredRegex || []),
|
|
461
|
+
...screenshotPatterns,
|
|
462
|
+
...testFilePatterns,
|
|
463
|
+
...stencilGeneratedPatterns,
|
|
464
|
+
],
|
|
456
465
|
};
|
|
457
466
|
// Create temp file as sibling of stencil.config so tsconfig.json can be found
|
|
458
467
|
// Stencil looks for tsconfig.json relative to the config file location
|
|
@@ -483,7 +492,7 @@ async function createTemporaryStencilConfig(userSpecifiedConfig, vitestConfigPat
|
|
|
483
492
|
writeFileSync(tempConfigPath, tempConfigContent, 'utf-8');
|
|
484
493
|
if (verbose) {
|
|
485
494
|
log(`Created temporary stencil config at ${tempConfigPath}`);
|
|
486
|
-
log(`Added ${screenshotPatterns.length} screenshot
|
|
495
|
+
log(`Added ${screenshotPatterns.length} screenshot, ${testFilePatterns.length} test file, and ${stencilGeneratedPatterns.length} generated file patterns to watch ignore`);
|
|
487
496
|
}
|
|
488
497
|
return tempConfigPath;
|
|
489
498
|
}
|
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.7.
|
|
7
|
+
"version": "1.7.2",
|
|
8
8
|
"description": "First-class testing utilities for Stencil design systems with Vitest",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"type": "module",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"dependencies": {
|
|
98
98
|
"jiti": "^2.6.1",
|
|
99
99
|
"local-pkg": "^1.1.2",
|
|
100
|
-
"vitest-environment-stencil": "1.7.
|
|
100
|
+
"vitest-environment-stencil": "1.7.2"
|
|
101
101
|
},
|
|
102
102
|
"devDependencies": {
|
|
103
103
|
"@eslint/js": "^9.39.2",
|