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/increase codecoverage #204

Merged
merged 27 commits into from
Jan 16, 2020
Merged

Conversation

adelkahomolova
Copy link
Contributor

Add tests to increase codecoverage

@adelkahomolova adelkahomolova self-assigned this Jan 14, 2020
@codecov-io
Copy link

codecov-io commented Jan 14, 2020

Codecov Report

Merging #204 into master will increase coverage by 0.56%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #204      +/-   ##
==========================================
+ Coverage   86.81%   87.38%   +0.56%     
==========================================
  Files         165      164       -1     
  Lines        3572     3559      -13     
  Branches      558      558              
==========================================
+ Hits         3101     3110       +9     
+ Misses        471      449      -22
Impacted Files Coverage Δ
src/practices/index.ts 100% <ø> (ø) ⬆️
...__/bitbucketServiceMockFolder/getIssuesResponse.ts 100% <ø> (ø) ⬆️
src/services/git/index.ts 100% <ø> (ø) ⬆️
src/services/git/VCSServicesUtils.ts 83.33% <100%> (ø) ⬆️
src/scanner/__MOCKS__/SecondTestPractice.mock.ts 42.85% <0%> (-57.15%) ⬇️
src/scanner/__MOCKS__/FirstTestPractice.mock.ts 42.85% <0%> (-57.15%) ⬇️
src/scanner/__MOCKS__/InvalidTestPractice.mock.ts 42.85% <0%> (-57.15%) ⬇️
src/scanner/Scanner.ts 31.75% <0%> (+0.67%) ⬆️
src/inspectors/FileInspector.ts 83.58% <0%> (+1.49%) ⬆️
... and 3 more

@prokopsimek
Copy link
Member

prokopsimek commented Jan 14, 2020

DX Scanner Report DXScanner.io

https://github.com/DXHeroes/dx-scanner

⚠️ Improvements with medium impact

Solve Issues Continuously

Do not have an open Issues more than 60 days. Solve Issues continuously. https://hackernoon.com/45-github-issues-dos-and-donts-dfec9ab4b612

Update Dependencies of Minor and Patch Level

Keep the dependencies updated to eliminate security concerns and compatibility issues. Use, for example, npm-check-updates. https://github.com/tjunnone/npm-check-updates

Name New Current
@commitlint/lint 8.3.5 8.3.4
memfs 3.0.4 3.0.3
ts-node 8.6.2 8.6.1
@types/node 13.1.7 12.12.24
semantic-release 16.0.2 16.0.1
@types/jest 24.9.0 24.0.25
@typescript-eslint/eslint-plugin 2.16.0 2.15.0
@typescript-eslint/parser 2.16.0 2.15.0

Impact changed from high to medium.

ESLint Without Errors

Use the ESLint correctly. You have some errors. https://eslint.org/

🔔 Improvements with minor impact

Write Commit Messages by Convention

https://www.conventionalcommits.org/

Commit Message Problems
docs: Travis badge uses a master branch to show build status subject must not be sentence-case, start-case, pascal-case, upper-case
chore: use listIssueComments for GitHub to list comments for a pull request header must not be longer than 72 characters, current length is 75
Update Dependencies of Major Level

Keep the dependencies updated to have all possible features. Use, for example, npm-check-updates. https://github.com/tjunnone/npm-check-updates

Name New Current
@types/node 13.1.7 12.12.24
Use a JS Logging Library

Use a logging library to avoid errors and even cyber attacks. The most widely used logging library in the JavaScript community is Winston. https://www.npmjs.com/package/winston/

🔥 Evaluation of these practices failed - Break down large pull requests into smaller ones

Implementation is not adoption.
We can help you with both. :-)
dxheroes.io

Found a bug? Please report.

@adelkahomolova adelkahomolova marked this pull request as ready for review January 15, 2020 22:00
Comment on lines 18 to 54
// beforeEach(() => {
// virtualFileSystemService = new FileSystemService({ isVirtual: true });
// fileInspector = new FileInspector(virtualFileSystemService, '/');
// });

afterEach(async () => {
containerCtx.virtualFileSystemService.clearFileSystem();
containerCtx.practiceContext.fileInspector!.purgeCache();
});

it('Throws an error if the file does not exist', async () => {
const path = './';
// const structure: DirectoryJSON = {
// '/index.cpp': '...',
// };

// virtualFileSystemService.setFileSystem(structure);
try {
await fileInspector.scanFor('not.exist', path);
fail();
} catch (error) {
expect(error.message).toEqual(`ENOENT: no such file or directory, readdir '${path}'`);
}
// expect(async () => {
// await fileInspector.scanFor('not.exist', path);
// }).toThrow();
});

// it('Returns practicing if there is a .gitignore', async () => {
// const structure: DirectoryJSON = {
// '/index.cpp': '...',
// };

// virtualFileSystemService.setFileSystem(structure);
// const isFile = await fileInspector.isFile('/index.cpp');
// expect(isFile).toEqual(true);
// });
Copy link
Member

Choose a reason for hiding this comment

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

remove comments

@@ -67,6 +68,20 @@ describe('ThinPullRequestsPractice', () => {
expect(evaluated).toEqual(PracticeEvaluationResult.notPracticing);
});

it('return unknown if there is no PR', async () => {
mockCollaborationInspector.listPullRequests = async () => {
const pr = _.cloneDeep(getPullRequestsResponse());
Copy link
Member

Choose a reason for hiding this comment

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

?

@adelkahomolova adelkahomolova merged commit 2bf77b0 into master Jan 16, 2020
@adelkahomolova adelkahomolova deleted the test/increase-codecoverage branch January 16, 2020 16:27
@prokopsimek
Copy link
Member

🎉 This PR is included in version 1.35.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants