@stencil/core 4.8.0-dev.1701234106.8f03983 → 4.8.0-dev.1701320525.33f5158

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.
@@ -14,7 +14,21 @@
14
14
  import type { TransformedSource } from '@jest/transform';
15
15
  import type { Config } from '@jest/types';
16
16
  import * as d from '@stencil/core/internal';
17
- export type JestPuppeteerEnvironment = any;
17
+ /**
18
+ * For Stencil's purposes, an instance of a Jest/Puppeteer environment only needs to have a handful of functions.
19
+ * This does not mean that Jest does not require additional functions on an environment. However, those requirements may
20
+ * change from version-to-version of Jest. Stencil overrides the functions below, and with our current design of
21
+ * integrating with Jest, require them to be overridden.
22
+ */
23
+ export type JestPuppeteerEnvironment = {
24
+ setup(): Promise<void>;
25
+ teardown(): Promise<void>;
26
+ getVmContext(): any | null;
27
+ };
28
+ /**
29
+ * Helper type for describing a function that returns a {@link JestPuppeteerEnvironment}.
30
+ */
31
+ export type JestPuppeteerEnvironmentConstructor = new (...args: any[]) => JestPuppeteerEnvironment;
18
32
  export type JestPreprocessor = {
19
33
  process(sourceText: string, sourcePath: string, ...args: any[]): string | TransformedSource;
20
34
  getCacheKey(sourceText: string, sourcePath: string, ...args: any[]): string;
@@ -1,4 +1,4 @@
1
- import { JestCliRunner, JestPreprocessor, JestPresetConfig, JestPuppeteerEnvironment, JestScreenshotRunner, JestTestRunnerConstructor } from './jest-apis';
1
+ import { JestCliRunner, JestPreprocessor, JestPresetConfig, JestPuppeteerEnvironmentConstructor, JestScreenshotRunner, JestTestRunnerConstructor } from './jest-apis';
2
2
  /**
3
3
  * Interface for Jest-version specific code implementations that interact with Stencil.
4
4
  *
@@ -37,7 +37,7 @@ export interface JestFacade {
37
37
  *
38
38
  * @returns A function that builds an E2E testing environment.
39
39
  */
40
- getCreateJestPuppeteerEnvironment(): () => JestPuppeteerEnvironment;
40
+ getCreateJestPuppeteerEnvironment(): () => JestPuppeteerEnvironmentConstructor;
41
41
  /**
42
42
  * Create an object used to transform files as a part of running Jest.
43
43
  *
@@ -38,7 +38,7 @@ export declare const getScreenshot: () => JestScreenshotRunner;
38
38
  *
39
39
  * @returns a function capable of creating a Jest-Puppeteer environment
40
40
  */
41
- export declare const getCreateJestPuppeteerEnvironment: () => () => any;
41
+ export declare const getCreateJestPuppeteerEnvironment: () => () => import("./jest-apis").JestPuppeteerEnvironmentConstructor;
42
42
  /**
43
43
  * Retrieve the Jest preprocessor, based on the version of Jest that is installed
44
44
  *
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/testing",
3
- "version": "4.8.0-dev.1701234106.8f03983",
3
+ "version": "4.8.0-dev.1701320525.33f5158",
4
4
  "description": "Stencil testing suite.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",