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

add more tests, use the Sourcegraph stubs api and improve repo matching. #13

Merged
merged 40 commits into from
May 21, 2019

Conversation

vanesa
Copy link
Contributor

@vanesa vanesa commented Apr 23, 2019

Use the Sourcegraph stubs api for testing, improve repo matching.

@vanesa vanesa requested a review from lguychard April 23, 2019 23:59
src/test/stubs.ts Outdated Show resolved Hide resolved
src/test/extension.test.ts Outdated Show resolved Hide resolved

describe('extension', () => {
it('works', () => void 0)
})

describe('check for extension activation', () => {
it('activate extension', () => expect(activate(sourcegraph.ExtensionContext)).toEqual(void 0))

Choose a reason for hiding this comment

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

This works in that it checks that the extension's activate function does not crash when called. However it doesn't test much beyond that. I would add more comprehensive tests for the actual functionality, for instance:

  • The extension reacts to windows/editor changes and decorates editors accordingly
  • The extension reacts to configuration changes and decorates editors accordingly

src/test/extension.test.ts Outdated Show resolved Hide resolved
src/test/extension.test.ts Outdated Show resolved Hide resolved
src/test/extension.test.ts Outdated Show resolved Hide resolved
src/test/extension.test.ts Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
@vanesa vanesa marked this pull request as ready for review May 8, 2019 22:08
@codecov-io
Copy link

codecov-io commented May 9, 2019

Codecov Report

Merging #13 into master will increase coverage by 9.39%.
The diff coverage is 90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #13      +/-   ##
==========================================
+ Coverage   75.72%   85.12%   +9.39%     
==========================================
  Files           3        3              
  Lines         103      121      +18     
  Branches       20       29       +9     
==========================================
+ Hits           78      103      +25     
+ Misses         25       18       -7
Impacted Files Coverage Δ
src/settings.ts 100% <ø> (ø) ⬆️
src/handler.ts 100% <100%> (+17.5%) ⬆️
src/extension.ts 74.64% <73.91%> (+4.15%) ⬆️

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 b49a375...622bf92. Read the comment docs.

@vanesa vanesa changed the title add more tests, extend the mock API to test activate add more tests, use the Sourcegraph stubs api and improve repo matching. May 13, 2019
@vanesa vanesa requested a review from felixfbecker May 15, 2019 19:11
src/handler.ts Outdated Show resolved Hide resolved
src/handler.ts Show resolved Hide resolved
src/handler.ts Outdated Show resolved Hide resolved
src/handler.ts Outdated Show resolved Hide resolved
src/settings.ts Outdated Show resolved Hide resolved
@vanesa vanesa requested a review from felixfbecker May 16, 2019 05:04
src/handler.ts Outdated Show resolved Hide resolved
src/handler.ts Outdated Show resolved Hide resolved
src/handler.ts Show resolved Hide resolved
src/handler.ts Outdated Show resolved Hide resolved
src/handler.ts Outdated Show resolved Hide resolved
src/handler.ts Outdated Show resolved Hide resolved
src/extension.ts Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
Loïc Guychard and others added 4 commits May 21, 2019 12:19
linePatterns, repositories and files were typed as RegExp[], but the user would have actually entered them as string[]. Having them typed as RegExp[] hid potential bugs where their real type would not have been handled properly.
@vanesa vanesa merged commit 7e69ceb into master May 21, 2019
@vanesa vanesa deleted the vo/increase-test-coverage branch May 21, 2019 19:38
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.

6 participants