@stencil/vitest 1.1.5 → 1.1.7

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.
@@ -270,6 +270,8 @@ export default {
270
270
  writeFileSync(join(testDir, 'package.json'), JSON.stringify({ name: 'test', type: 'module' }));
271
271
  // Run and then kill
272
272
  await runCLIInDir(testDir, ['--watch', '--verbose'], 2000);
273
+ // Wait for filesystem to sync (Windows can be slow)
274
+ await new Promise((resolve) => setTimeout(resolve, 500));
273
275
  // Check that temp config was cleaned up
274
276
  const tempConfigs = require('fs')
275
277
  .readdirSync(testDir)
@@ -391,19 +391,20 @@ async function createTemporaryStencilConfig(userSpecifiedConfig, vitestConfigPat
391
391
  const tempConfigPath = join(cwd, `.stencil-test-${Date.now()}.config.mjs`);
392
392
  // Serialize the config - convert RegExp objects to strings for the output
393
393
  const patternsArray = mergedConfig.watchIgnoredRegex.map((pattern) => pattern.toString()).join(',\n ');
394
- // Create config without watchIgnoredRegex first
395
- const { _watchIgnoredRegex, ...configWithoutWatch } = mergedConfig;
396
- // Generate a simple config that doesn't need imports
394
+ // Generate a simple config with user config import
397
395
  const tempConfigContent = `
398
- // Auto-generated temporary config by stencil-test
399
- // This extends your stencil config and adds watchIgnoredRegex for screenshot files
400
- export const config = {
401
- ${JSON.stringify(configWithoutWatch, null, 2).slice(2, -2)},
402
- "watchIgnoredRegex": [
403
- ${patternsArray}
404
- ]
405
- };
406
- `;
396
+ // Auto-generated temporary config by stencil-test
397
+ // This extends your stencil config and adds watchIgnoredRegex for screenshot files
398
+
399
+ import ${userConfig.config ? '{ config as baseConfig }' : 'baseConfig'} from '${userConfigPath}';
400
+
401
+ export const config = {
402
+ ...baseConfig,
403
+ "watchIgnoredRegex": [
404
+ ${patternsArray}
405
+ ]
406
+ };
407
+ `;
407
408
  writeFileSync(tempConfigPath, tempConfigContent, 'utf-8');
408
409
  if (verbose) {
409
410
  log(`Created temporary stencil config at ${tempConfigPath}`);
@@ -526,9 +527,13 @@ process.on('SIGTERM', () => cleanup());
526
527
  log(`Stencil exited with code ${code}`);
527
528
  }
528
529
  // In one-time build mode, stencil exits after build
529
- // Don't cleanup immediately - let tests finish first
530
+ // If build failed, exit with the failure code
530
531
  if (!args.watch) {
531
532
  stencilProcess = null;
533
+ if (code !== 0) {
534
+ log(`Stencil build failed with code ${code}`);
535
+ cleanup(code || 1);
536
+ }
532
537
  }
533
538
  else {
534
539
  // In watch mode, stencil shouldn't exit - if it does, something went wrong
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.5",
7
+ "version": "1.1.7",
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.5"
95
+ "vitest-environment-stencil": "1.1.7"
96
96
  },
97
97
  "devDependencies": {
98
98
  "@eslint/js": "^9.39.2",