Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(jest-runner): drop projectType "create-react-app-ts" (#2788)
Drop support for "react-scripts-ts" by removing "create-react-app-ts" project type from the jest-runner. Note: react with typescript is still supported, either by projectType custom or `create-react-app` dependent on the use case. See #2787 Closes #2787 BREAKING CHANGE: Support for project type `create-react-app-ts` is dropped from the jest-runner.
- Loading branch information
Showing
17 changed files
with
203 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 0 additions & 45 deletions
45
packages/jest-runner/src/config-loaders/react-scripts-ts-jest-config-loader.ts
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
packages/jest-runner/test/integration/create-react-app.it.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { commonTokens } from '@stryker-mutator/api/plugin'; | ||
import { SuccessTestResult } from '@stryker-mutator/api/test-runner'; | ||
import { assertions, factory, testInjector } from '@stryker-mutator/test-helpers'; | ||
import { expect } from 'chai'; | ||
|
||
import { JestRunnerOptionsWithStrykerOptions } from '../../src/jest-runner-options-with-stryker-options'; | ||
import { JestTestRunner, jestTestRunnerFactory } from '../../src/jest-test-runner'; | ||
import { createJestOptions } from '../helpers/producers'; | ||
import { resolveTestResource } from '../helpers/resolve-test-resource'; | ||
|
||
describe('JestTestRunner with "create-react-app" project type', () => { | ||
let sut: JestTestRunner; | ||
|
||
beforeEach(() => { | ||
process.chdir(resolveTestResource('my-react-app')); | ||
const options: JestRunnerOptionsWithStrykerOptions = factory.strykerWithPluginOptions({ | ||
jest: createJestOptions({ | ||
projectType: 'create-react-app', | ||
}), | ||
}); | ||
sut = testInjector.injector.provideValue(commonTokens.options, options).injectFunction(jestTestRunnerFactory); | ||
}); | ||
|
||
it('should be able to run the tests', async () => { | ||
const result = await sut.dryRun({ coverageAnalysis: 'off' }); | ||
|
||
const expectedTest: Omit<SuccessTestResult, 'timeSpentMs'> = { | ||
id: 'renders learn react link', | ||
name: 'renders learn react link', | ||
status: 0, | ||
}; | ||
|
||
assertions.expectCompleted(result); | ||
expect(result.tests).lengthOf(1); | ||
expect(result.tests[0]).deep.contains(expectedTest); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 0 additions & 75 deletions
75
packages/jest-runner/test/unit/config-loaders/react-scripts-ts-jest-config-loader.spec.ts
This file was deleted.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
packages/jest-runner/testResources/my-react-app/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"name": "my-react-app", | ||
"version": "0.1.0", | ||
"private": true, | ||
"dependencies": { | ||
"@testing-library/jest-dom": "^5.11.4", | ||
"@testing-library/react": "^11.1.0", | ||
"@testing-library/user-event": "^12.1.10", | ||
"react": "^17.0.1", | ||
"react-dom": "^17.0.1", | ||
"react-scripts": "4.0.3", | ||
"web-vitals": "^1.0.1" | ||
}, | ||
"scripts": { | ||
"start": "react-scripts start", | ||
"build": "react-scripts build", | ||
"test": "react-scripts test", | ||
"eject": "react-scripts eject" | ||
}, | ||
"eslintConfig": { | ||
"extends": [ | ||
"react-app", | ||
"react-app/jest" | ||
] | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
} | ||
} |
Oops, something went wrong.