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

[tests-only] remove language related log outputs in unit-tests #6404

Merged
merged 6 commits into from
Feb 11, 2022

Conversation

individual-it
Copy link
Member

@individual-it individual-it commented Feb 9, 2022

Description

  • mock $ngettext & $pgettext
  • shallowMount in Project.spec.js
  • mock <translate> in Projects.spec.js & LocationPicker.spec.js
  • mock v-translate directive

Related Issue

part of #6337

Motivation and Context

reduce log output in unit tests

How Has This Been Tested?

yarn run test:unit 2>&1 | wc -l

before this PR: 2641
after this PR: 583

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • ...

Copy link
Contributor

@pascalwengerter pascalwengerter left a comment

Choose a reason for hiding this comment

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

This looks pretty neat already, but running yarn test:unit packages/web-app-files/tests/unit/views there's still some No translations found for en_US from views that are not included in this PR. Is there a specific reason you left them out?
Awesome progress on the topic btw!

@individual-it
Copy link
Member Author

@pascalwengerter yes, those are form v-translate I could not quickly find a way to stub them

@individual-it
Copy link
Member Author

Any idea how to do that?

@kulmann
Copy link
Contributor

kulmann commented Feb 10, 2022

Any idea how to do that?

Should be possible like this vuejs/vue-test-utils#450 (comment) - global mock would be nicer though 🤔

@individual-it individual-it force-pushed the reduceLogOutput/language branch from de8bba5 to 46aea07 Compare February 11, 2022 08:33
@individual-it individual-it changed the title [tests-only] reduce language related log outputs in unit-tests [tests-only] remove language related log outputs in unit-tests Feb 11, 2022
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@individual-it
Copy link
Member Author

@kulmann thank you for the tip, I've mocked it in 46aea07
@pascalwengerter now all translation output should be gone

please review again

Copy link
Contributor

@kulmann kulmann left a comment

Choose a reason for hiding this comment

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

😍

@kulmann kulmann merged commit ef5c2ae into master Feb 11, 2022
@delete-merged-branch delete-merged-branch bot deleted the reduceLogOutput/language branch February 11, 2022 09:44
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