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

fix: move tests into lib #5635

Merged
merged 9 commits into from
Mar 5, 2020

Conversation

ViralRuparel
Copy link
Contributor

Moves all the test files from test folder to lib folder

Closes #5606

@ViralRuparel ViralRuparel changed the title [WIP] fix: move tests into lib fix: move tests into lib [WIP] Mar 4, 2020
@ViralRuparel ViralRuparel changed the title fix: move tests into lib [WIP] fix: move tests into lib Mar 4, 2020
@ViralRuparel
Copy link
Contributor Author

Ready for review @rarkins

@rarkins rarkins requested a review from viceice March 5, 2020 05:15
@@ -9,7 +9,7 @@ describe('platform/azure/helpers', () => {
// reset module
jest.resetModules();
jest.mock('../../../lib/platform/azure/azure-got-wrapper');
azureHelper = require('../../../lib/platform/azure/azure-helper');
azureHelper = require('.../../../lib/platform/azure/azure-helper');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
azureHelper = require('.../../../lib/platform/azure/azure-helper');
azureHelper = require('./azure-helper');

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done everywhere in all the test files.

@@ -179,7 +179,7 @@ function generateServerResponses(endpoint) {
[`${endpoint}/rest/api/1.0/projects/SOME/repos/repo/pull-requests/5/commits?withCounts=true`]: {
GET: {
totalCount: 1,
values: [ { author: { emailAddress: 'bot@renovateapp.com'} } ],
values: [{ author: { emailAddress: 'bot@renovateapp.com' } }],
Copy link
Collaborator

Choose a reason for hiding this comment

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

@viceice on one hand I was going to say "Revert formatting changes to fixtures" but on the other hand I wonder if this file is an indicator that prettier is picking up *.ts files within __fixtures__ and needs reconfiguring?

import { GotFn } from '../../../lib/util/got';
import { GiteaGotApi } from '../../../lib/platform/gitea/gitea-got-wrapper';
import { GotResponse } from '..';
import { partial } from '../../../test/util';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Need to work out what to do about this util file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes please suggest, until then keeping as is.

@@ -1,4 +1,4 @@
import { api as semver } from '../../lib/versioning/poetry';
import { api as semver } from '.';
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should rename these types of files to index.spec.ts now that they're within lib. Please check all versioning, manager and datasource ones

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay will change the names

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done with this too.

@rarkins
Copy link
Collaborator

rarkins commented Mar 5, 2020

@viceice any ideas on what to do about the test/util code that remains?

@rarkins
Copy link
Collaborator

rarkins commented Mar 5, 2020

This is how the test/ directory looks now:

image

I guess it's ok to leave as-is. I can't think of any better alternatives.

For instance, I thought about moving the docs test into docs/ but that could be "messy" for someone browsing the repo just for the docs and not source code.

@ViralRuparel ViralRuparel changed the title fix: move tests into lib fix: move tests into lib WIP Mar 5, 2020
@ViralRuparel ViralRuparel changed the title fix: move tests into lib WIP fix: move tests into lib Mar 5, 2020
@ViralRuparel
Copy link
Contributor Author

Again ready for review @rarkins with all the suggested changes and renaming of test files done.

@rarkins rarkins merged commit 364163e into renovatebot:master Mar 5, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2020

🎉 This PR is included in version 19.158.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

viceice pushed a commit that referenced this pull request Mar 6, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move tests into lib
2 participants