Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow unmatched test paths from CLI #3882

Merged
merged 4 commits into from
Jan 6, 2018

Conversation

valerybugakov
Copy link
Contributor

Summary

Fixes #3755 and #3793

Test plan

Examples provided in issues above.
Added an ability to run tests by provided filenames: jest ../foo.js ../tests/bar.js ./src/baz.js

Will add tests if fixes are ok.

@codecov-io
Copy link

codecov-io commented Jun 22, 2017

Codecov Report

Merging #3882 into master will decrease coverage by 0.02%.
The diff coverage is 14.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3882      +/-   ##
==========================================
- Coverage   60.58%   60.56%   -0.03%     
==========================================
  Files         201      201              
  Lines        6686     6690       +4     
  Branches        4        4              
==========================================
+ Hits         4051     4052       +1     
- Misses       2635     2638       +3
Impacted Files Coverage Δ
packages/jest-cli/src/search_source.js 42.1% <14.28%> (-0.96%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 78477eb...04a5ba0. Read the comment docs.

Copy link
Contributor

@aaronabramov aaronabramov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aren't those two separate issues?
i'd split it into two PRs
the console part looks awesome :)

@@ -76,6 +77,15 @@ const toTests = (context, tests) =>
path,
}));

const fileExists = (filePath: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already have like 3 functions like this in the codebase. It sucks that we can't just share it :(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would share it between packages too, but where to put it? Into jest-util?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just use fs.existsSync() )

@@ -57,25 +59,28 @@ class DefaultReporter extends BaseReporter {
let buffer = [];
let timeout = null;

const doFlush = () => {
const flushBufferedIO = () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not really an IO, more like.. just O :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe just call it flushBufferedOutput?

return true;
};
}

flushDebouncedIO() {
for (const io of this._bufferedIO) {
io();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be flushBufferedOutput() as well

@thymikee thymikee changed the title Allow precise filenames and console.log output fix Allow unmatched test paths from CLI Jun 24, 2017
@valerybugakov
Copy link
Contributor Author

valerybugakov commented Jun 24, 2017

Removed part about DefaultReporter and added tests. Anything else to do here?

@cpojer
Copy link
Member

cpojer commented Aug 24, 2017

cc @aaronabramov what's the status of this? Is this good for 21?

@SimenB
Copy link
Member

SimenB commented Oct 10, 2017

I'd like to see a flag added for the old behaviour. Or at least output a string saying that during a normal test run the file would not be executed. It's useful info when trying to understand why a test is not run in CI (ref #4630)

/**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
Copy link
Member

@SimenB SimenB Oct 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be MIT

@cpojer
Copy link
Member

cpojer commented Dec 15, 2017

@valerybugakov do you mind addressing the change requests by @SimenB?

@valerybugakov
Copy link
Contributor Author

valerybugakov commented Dec 15, 2017

@cpojer np, rebased with master

@cpojer
Copy link
Member

cpojer commented Dec 16, 2017

@valerybugakov do you mind also fixing the tests so we can land this? :)

@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jest swallows console output with --bail
7 participants