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

test: correct unit tests and e2e tests for language service #1579

Merged
merged 1 commit into from
Apr 30, 2020

Conversation

ahnpnl
Copy link
Collaborator

@ahnpnl ahnpnl commented Apr 29, 2020

Summary

Added unit tests for language-service.ts and remove unnecessary e2e tests.

Test plan

Green CI

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

N.A.

@ahnpnl ahnpnl requested a review from kulshekhar as a code owner April 29, 2020 21:41
@@ -172,8 +170,7 @@ export const initializeLanguageServiceInstance = (
* test file for 1st time run after clearing cache because
*/
return (
entry[1].modulePaths.find(modulePath => modulePath === fileName) &&
!hasOwn.call(memoryCache.files, entry[0])
entry[1].modulePaths.find(modulePath => modulePath === fileName) && !memoryCache.files.has(entry[0])
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I modified our internal memory cache in #1574 but forgot this one. It doesn't cause any bugs or performance issue but 'the fastest code is the code which does nothing' so it's better to correct this condition.

logTarget.clear()
compiler.compile(importedModuleSrc, require.resolve('../__mocks__/unchanged-modules/main.ts'))

expect(logTarget.filteredLines(LogLevels.debug, Infinity)).toMatchInlineSnapshot(`
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We just need to verify logging for assertion related to https://github.com/kulshekhar/ts-jest/pull/1579/files#diff-124008e76d6a710666b8d995ffc3758fR173 (the condition which is fixed in the below comment)

@coveralls
Copy link

Pull Request Test Coverage Report for Build 4613

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.09%) to 92.885%

Totals Coverage Status
Change from base Build 4596: 0.09%
Covered Lines: 1070
Relevant Lines: 1106

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants