Skip to content

Commit 1b9bd8e

Browse files
authored
chore(test): remove old jest todos (#4861)
remove a handful of TODOs from the Jest 27 and under section of the codebase. these TODOs were originally written when we planned to have to continue to maintain the internally used version of Jest and the one users use, keeping them in sync. now that these two versions of jest are independent, we can remove these TODOs (as the Jest 27 and under code is not expected to be changed for Jest 28).
1 parent 14328ac commit 1b9bd8e

4 files changed

Lines changed: 0 additions & 8 deletions

File tree

src/testing/jest/jest-27-and-under/jest-config.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { Config } from '@jest/types';
22
import type * as d from '@stencil/core/internal';
33
import { isString } from '@utils';
44

5-
// TODO(STENCIL-306): Remove support for earlier versions of Jest
65
/**
76
* Helper function for retrieving legacy Jest options. These options have been provided as defaults to Stencil users
87
* by Jest + yargs for all users using Jest versions 24 through 26 (inclusively). Between Jest v26 and v27, a few
@@ -146,7 +145,6 @@ export function buildJestConfig(config: d.ValidatedConfig): string {
146145
jestConfig.verbose = stencilConfigTesting.verbose;
147146
}
148147

149-
// TODO(STENCIL-307): Move away from Jasmine runner for Stencil tests, which involves a potentially breaking change
150148
jestConfig.testRunner = 'jest-jasmine2';
151149

152150
return JSON.stringify(jestConfig);

src/testing/jest/jest-27-and-under/jest-preprocessor.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { loadTypeScriptDiagnostic, normalizePath } from '@utils';
44

55
import { transpile } from '../../test-transpile';
66

7-
// TODO(STENCIL-306): Remove support for earlier versions of Jest
87
type Jest26CacheKeyOptions = { instrument: boolean; rootDir: string };
98
type Jest26Config = { instrument: boolean; rootDir: string };
109
type Jest27TransformOptions = { config: Jest26Config };
@@ -58,7 +57,6 @@ export const jestPreprocessor = {
5857
jestConfig: Jest26Config | Jest27TransformOptions,
5958
transformOptions?: Jest26Config,
6059
): string {
61-
// TODO(STENCIL-306): Drop support for versions of Jest <27
6260
/**
6361
* As of Jest 27, `jestConfig` changes its shape (as it's been moved into `transformOptions`). To preserve
6462
* backwards compatibility, we allow Jest to pass 4 arguments and check the shape of the third and fourth arguments
@@ -134,7 +132,6 @@ export const jestPreprocessor = {
134132
jestConfigStr: string | Jest27TransformOptions,
135133
transformOptions?: Jest26CacheKeyOptions,
136134
): string {
137-
// TODO(STENCIL-306): Remove support for earlier versions of Jest
138135
/**
139136
* As of Jest 27, jestConfigStr is no longer an accepted argument (as it's been moved into `transformOptions`). To
140137
* preserve backwards compatibility, we allow Jest to pass 4 arguments and check the shape of the third and fourth

src/testing/jest/jest-27-and-under/jest-runner.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ export async function runJest(config: d.ValidatedConfig, env: d.E2EProcessEnv) {
5050
* @returns the test runner
5151
*/
5252
export function createTestRunner(): any {
53-
// TODO(STENCIL-306): Remove support for earlier versions of Jest
5453
// The left hand side of the '??' is needed for Jest v27, the right hand side for Jest 26 and below
5554
const TestRunner = require('jest-runner').default ?? require('jest-runner');
5655

src/testing/jest/jest-27-and-under/jest-setup-test-framework.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ export function jestSetupTestFramework() {
6161
global.resourcesUrl = '/build';
6262
});
6363

64-
// TODO(STENCIL-307): Remove usage of the Jasmine global
6564
const jasmineEnv = (jasmine as any).getEnv();
6665
if (jasmineEnv != null) {
6766
jasmineEnv.addReporter({
@@ -79,7 +78,6 @@ export function jestSetupTestFramework() {
7978
if (typeof env.__STENCIL_DEFAULT_TIMEOUT__ === 'string') {
8079
const time = parseInt(env.__STENCIL_DEFAULT_TIMEOUT__, 10);
8180
jest.setTimeout(time * 1.5);
82-
// TODO(STENCIL-307): Remove usage of the Jasmine global
8381
// eslint-disable-next-line jest/no-jasmine-globals -- these will be removed when we migrate to jest-circus
8482
jasmine.DEFAULT_TIMEOUT_INTERVAL = time;
8583
}

0 commit comments

Comments
 (0)