Skip to content

Commit 02f91b3

Browse files
authored
feat(testing): deprecate all integrated testing options (#6642)
1 parent 9080c9d commit 02f91b3

3 files changed

Lines changed: 74 additions & 0 deletions

File tree

src/cli/config-flags.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const BOOLEAN_CLI_FLAGS = [
1313
'dev',
1414
'devtools',
1515
'docs',
16+
// @deprecated - integrated testing will be removed in Stencil v5. See https://github.com/stenciljs/core/issues/6584.
1617
'e2e',
1718
'es5',
1819
'esm',
@@ -24,16 +25,21 @@ export const BOOLEAN_CLI_FLAGS = [
2425
'prod',
2526
'profile',
2627
'serviceWorker',
28+
// @deprecated - screenshot testing will be removed in Stencil v5. See https://github.com/stenciljs/core/issues/6584.
2729
'screenshot',
2830
'serve',
2931
'skipNodeCheck',
32+
// @deprecated - integrated testing will be removed in Stencil v5. See https://github.com/stenciljs/core/issues/6584.
3033
'spec',
3134
'ssr',
35+
// @deprecated - screenshot testing will be removed in Stencil v5. See https://github.com/stenciljs/core/issues/6584.
3236
'updateScreenshot',
3337
'verbose',
3438
'version',
3539
'watch',
3640

41+
// @deprecated - all JEST CLI options below are only used by integrated testing, which will be removed in Stencil v5.
42+
// See https://github.com/stenciljs/core/issues/6584.
3743
// JEST CLI OPTIONS
3844
'all',
3945
'automock',
@@ -88,6 +94,8 @@ export const BOOLEAN_CLI_FLAGS = [
8894
*/
8995
export const NUMBER_CLI_FLAGS = [
9096
'port',
97+
// @deprecated - all JEST CLI args below are only used by integrated testing, which will be removed in Stencil v5.
98+
// See https://github.com/stenciljs/core/issues/6584.
9199
// JEST CLI ARGS
92100
'maxConcurrency',
93101
'testTimeout',
@@ -103,8 +111,11 @@ export const STRING_CLI_FLAGS = [
103111
'docsJson',
104112
'emulate',
105113
'root',
114+
// @deprecated - screenshot testing will be removed in Stencil v5. See https://github.com/stenciljs/core/issues/6584.
106115
'screenshotConnector',
107116

117+
// @deprecated - all JEST CLI args below are only used by integrated testing, which will be removed in Stencil v5.
118+
// See https://github.com/stenciljs/core/issues/6584.
108119
// JEST CLI ARGS
109120
'cacheDirectory',
110121
'changedSince',
@@ -138,6 +149,8 @@ export const STRING_CLI_FLAGS = [
138149
'transform',
139150
] as const;
140151

152+
// @deprecated - all entries below are JEST CLI args only used by integrated testing, which will be removed in Stencil v5.
153+
// See https://github.com/stenciljs/core/issues/6584.
141154
export const STRING_ARRAY_CLI_FLAGS = [
142155
'collectCoverageOnlyFrom',
143156
'coveragePathIgnorePatterns',

src/cli/task-test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ import type { TestingRunOptions, ValidatedConfig } from '../declarations';
66
* @returns a void promise
77
*/
88
export const taskTest = async (config: ValidatedConfig): Promise<void> => {
9+
config.logger.warn(
10+
config.logger.yellow(
11+
`[DEPRECATION] Stencil's integrated testing (the 'test' task, --spec and --e2e flags) is deprecated and will be removed in Stencil v5. ` +
12+
`Migrate spec tests to @stencil/vitest (https://github.com/stenciljs/vitest) and ` +
13+
`e2e / browser tests to either @stencil/vitest (https://github.com/stenciljs/vitest) or ` +
14+
`@stencil/playwright (https://github.com/stenciljs/playwright). ` +
15+
`See https://github.com/stenciljs/core/issues/6584 for full details.`,
16+
),
17+
);
918
config.buildDocs = false;
1019
const testingRunOpts: TestingRunOptions = {
1120
e2e: !!config.flags.e2e,

src/declarations/stencil-public-compiler.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,15 @@ export interface StencilConfig {
285285

286286
globalScript?: string;
287287
srcIndexHtml?: string;
288+
/**
289+
* Configuration for Stencil's integrated testing (Jest + Puppeteer).
290+
*
291+
* @deprecated Integrated testing support will be removed in Stencil v5. Migrate spec tests to
292+
* [`@stencil/vitest`](https://github.com/stenciljs/vitest) and e2e / browser tests to either
293+
* [`@stencil/vitest`](https://github.com/stenciljs/vitest) or
294+
* [`@stencil/playwright`](https://github.com/stenciljs/playwright).
295+
* See https://github.com/stenciljs/core/issues/6584 for full discussion and migration guidance.
296+
*/
288297
testing?: TestingConfig;
289298
maxConcurrentWorkers?: number;
290299
preamble?: string;
@@ -1899,6 +1908,13 @@ export interface RollupOutputOptions {
18991908
globals?: { [name: string]: string } | ((name: string) => string);
19001909
}
19011910

1911+
/**
1912+
* @deprecated Integrated testing support will be removed in Stencil v5. Migrate spec tests to
1913+
* [`@stencil/vitest`](https://github.com/stenciljs/vitest) and e2e / browser tests to either
1914+
* [`@stencil/vitest`](https://github.com/stenciljs/vitest) or
1915+
* [`@stencil/playwright`](https://github.com/stenciljs/playwright).
1916+
* See https://github.com/stenciljs/core/issues/6584 for full discussion and migration guidance.
1917+
*/
19021918
export interface Testing {
19031919
run(opts: TestingRunOptions): Promise<boolean>;
19041920
destroy(): Promise<void>;
@@ -1909,6 +1925,12 @@ export declare type TransformerConfig = [string, Record<string, unknown>];
19091925

19101926
/**
19111927
* Options for initiating a run of Stencil tests (spec and/or end-to-end)
1928+
*
1929+
* @deprecated Integrated testing support will be removed in Stencil v5. Migrate spec tests to
1930+
* [`@stencil/vitest`](https://github.com/stenciljs/vitest) and e2e / browser tests to either
1931+
* [`@stencil/vitest`](https://github.com/stenciljs/vitest) or
1932+
* [`@stencil/playwright`](https://github.com/stenciljs/playwright).
1933+
* See https://github.com/stenciljs/core/issues/6584 for full discussion and migration guidance.
19121934
*/
19131935
export interface TestingRunOptions {
19141936
/**
@@ -1929,6 +1951,13 @@ export interface TestingRunOptions {
19291951
updateScreenshot?: boolean;
19301952
}
19311953

1954+
/**
1955+
* @deprecated Integrated testing support will be removed in Stencil v5. Migrate spec tests to
1956+
* [`@stencil/vitest`](https://github.com/stenciljs/vitest) and e2e / browser tests to either
1957+
* [`@stencil/vitest`](https://github.com/stenciljs/vitest) or
1958+
* [`@stencil/playwright`](https://github.com/stenciljs/playwright).
1959+
* See https://github.com/stenciljs/core/issues/6584 for full discussion and migration guidance.
1960+
*/
19321961
export interface JestConfig {
19331962
/**
19341963
* This option tells Jest that all imported modules in your tests should be mocked automatically.
@@ -2061,6 +2090,15 @@ export interface JestConfig {
20612090
watchPathIgnorePatterns?: any[];
20622091
}
20632092

2093+
/**
2094+
* Configuration for Stencil's integrated testing (Jest + Puppeteer).
2095+
*
2096+
* @deprecated Integrated testing support will be removed in Stencil v5. Migrate spec tests to
2097+
* [`@stencil/vitest`](https://github.com/stenciljs/vitest) and e2e / browser tests to either
2098+
* [`@stencil/vitest`](https://github.com/stenciljs/vitest) or
2099+
* [`@stencil/playwright`](https://github.com/stenciljs/playwright).
2100+
* See https://github.com/stenciljs/core/issues/6584 for full discussion and migration guidance.
2101+
*/
20642102
export interface TestingConfig extends JestConfig {
20652103
/**
20662104
* The `allowableMismatchedPixels` value is used to determine an acceptable
@@ -2168,6 +2206,13 @@ export interface TestingConfig extends JestConfig {
21682206
waitBeforeScreenshot?: number;
21692207
}
21702208

2209+
/**
2210+
* @deprecated Integrated testing support will be removed in Stencil v5. Migrate spec tests to
2211+
* [`@stencil/vitest`](https://github.com/stenciljs/vitest) and e2e / browser tests to either
2212+
* [`@stencil/vitest`](https://github.com/stenciljs/vitest) or
2213+
* [`@stencil/playwright`](https://github.com/stenciljs/playwright).
2214+
* See https://github.com/stenciljs/core/issues/6584 for full discussion and migration guidance.
2215+
*/
21712216
export interface EmulateConfig {
21722217
/**
21732218
* Predefined device descriptor name, such as "iPhone X" or "Nexus 10".
@@ -2183,6 +2228,13 @@ export interface EmulateConfig {
21832228
viewport?: EmulateViewport;
21842229
}
21852230

2231+
/**
2232+
* @deprecated Integrated testing support will be removed in Stencil v5. Migrate spec tests to
2233+
* [`@stencil/vitest`](https://github.com/stenciljs/vitest) and e2e / browser tests to either
2234+
* [`@stencil/vitest`](https://github.com/stenciljs/vitest) or
2235+
* [`@stencil/playwright`](https://github.com/stenciljs/playwright).
2236+
* See https://github.com/stenciljs/core/issues/6584 for full discussion and migration guidance.
2237+
*/
21862238
export interface EmulateViewport {
21872239
/**
21882240
* Page width in pixels.

0 commit comments

Comments
 (0)