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

Vscode jest monorepo support #4572

Merged
merged 4 commits into from
Oct 1, 2017

Conversation

connectdotz
Copy link
Contributor

Summary
Added the following changes to provide more reliable support for monorepo projects for vscode-jest:

  • option to start the Runner in either watch mode or non-watch mode.
  • return parse results from test_reconciler. updateFileWithJestStatus() instead of storing them as instance-variables (mainly to avoid race-condition for subsequent runs, bonus of reducing duplicate data).
  • bring the jest-test-typescript-parser typescript version to the latest (2.5.3)

mainly to support a monorepo projects environment that needs to have an overrall view of all the projects, not just the one changed. see #129 for more detail.

Test plan

  • added more test for test_reconciler to verify its states across multiple runs.

Note
since the test_reconciler has a non-backward compatible API change, not sure if there is any 3rd party package, other than vscode-jest, would be impacted. What is the guideline for changes like that... please advise.

@cpojer
Copy link
Member

cpojer commented Sep 30, 2017

cc @orta

@codecov-io
Copy link

codecov-io commented Sep 30, 2017

Codecov Report

Merging #4572 into master will increase coverage by 0.01%.
The diff coverage is 77.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4572      +/-   ##
==========================================
+ Coverage   55.61%   55.63%   +0.01%     
==========================================
  Files         186      186              
  Lines        6354     6347       -7     
  Branches        3        3              
==========================================
- Hits         3534     3531       -3     
+ Misses       2819     2815       -4     
  Partials        1        1
Impacted Files Coverage Δ
packages/jest-editor-support/src/Runner.js 72.97% <100%> (+1.54%) ⬆️
...ackages/jest-editor-support/src/test_reconciler.js 78.26% <66.66%> (+4.67%) ⬆️
packages/jest-docblock/src/index.js 100% <0%> (ø) ⬆️

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 4a3ab53...970e118. Read the comment docs.

});

describe('Terse Messages', () => {
let parser: TestReconciler;
// let results: TestFileAssertionStatus[];
Copy link
Member

Choose a reason for hiding this comment

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

left over comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

fails: Array<TestFileAssertionStatus>;
passes: Array<TestFileAssertionStatus>;
skips: Array<TestFileAssertionStatus>;
fileStatuses: {[key: string]: TestFileAssertionStatus};
Copy link
Member

Choose a reason for hiding this comment

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

nice work 👍

// the processed test results will be returned immediately instead of saved in
// instance properties. This is 1) to prevent race condition 2) the data is already
// stored in the this.fileStatuses, no dup is better 3) client will most likely need to process
// all the results anyway.
Copy link
Member

Choose a reason for hiding this comment

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

yeah, I think this is a better idea - good job 👍

"typescript": "^2.5.3"
},
"devDependencies": {
"typescript": "^2.5.3"
}
Copy link
Member

Choose a reason for hiding this comment

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

TypeScript is now in both deps + dev deps, I think it's fine in just deps 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that was dumb, fixed

verifyTest('passed', 'KnownSuccess');
});
});
});
});
Copy link
Member

Choose a reason for hiding this comment

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

The tests are 🥇

@cpojer cpojer merged commit c89ee8c into jestjs:master Oct 1, 2017
@cpojer
Copy link
Member

cpojer commented Oct 1, 2017

Nice work, looking forward to seeing this in vscode-jest.

tabrindle pushed a commit to tabrindle/jest that referenced this pull request Oct 2, 2017
* added watch mode and test_reconciler changes + upgrade typescript version

* upgrade typescript (jest-test-typescript-parser)

* clean up
@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.

5 participants