Add extra parameter: runTestsByPath. Fixes #4396#4411
Add extra parameter: runTestsByPath. Fixes #4396#4411cpojer merged 1 commit intojestjs:masterfrom mjesun:add-run-tests-by-path
Conversation
| } | ||
|
|
||
| findTests(paths: Array<Path>): SearchResult { | ||
| require('fs').writeFileSync('/tmp/lep', paths); |
| ) => { | ||
| const source = new SearchSource(context); | ||
| let data = await source.getTestPaths(globalConfig, changedFilesPromise); | ||
| if (!data.tests.length) { |
There was a problem hiding this comment.
probably me refactoring it last time and giving up on reading all if/else conditions :D
There was a problem hiding this comment.
That's because this if is useless.
| this._context, | ||
| paths | ||
| .map(p => path.resolve(process.cwd(), p)) | ||
| .filter(this.isTestFilePath.bind(this)), |
There was a problem hiding this comment.
What happens if it can't find any tests, what does the message look like and does it make sense?
|
I'll buy a test for 100 internet points. |
boujeepossum
left a comment
There was a problem hiding this comment.
can you write an integration test for it?
| }; | ||
| } | ||
|
|
||
| findTests(paths: Array<Path>): SearchResult { |
There was a problem hiding this comment.
can it be findTestsByPaths?
|
@cpojer that's called bitcoins nowadays |
|
Changed name from |
|
Tests still failing. |
Codecov Report
@@ Coverage Diff @@
## master #4411 +/- ##
==========================================
- Coverage 56.84% 56.66% -0.19%
==========================================
Files 191 191
Lines 6475 6493 +18
Branches 5 5
==========================================
- Hits 3681 3679 -2
- Misses 2791 2811 +20
Partials 3 3
Continue to review full report at Codecov.
|
|
@cpojer Looked at the error messages when failing and added an additional |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This option adds an extra
runTestsByPathparameter into the CLI. The goal of the parameter is to be able to execute tests by directly giving their path. Since the non-prefixed arguments right now are understood as patterns for file paths, this kind of worked, but when having more than 5k tests, the matching is quadratic and then it becomes unfeasible.