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] reduce log output in Projects unit tests #6411

Conversation

individual-it
Copy link
Member

Description

  • mock files-spaces-project route
  • mock SET_CURRENT_FOLDER in Files module

@JammingBen you have created those tests, any reason not to mock these things?

Related Issue

Motivation and Context

get rid of log outputs like:

  console.error
    [vuex] module namespace not found in mapMutations(): Files/

      188 |
      189 |     const loadResourcesTask = useTask(function* (signal, ref) {
    > 190 |       ref.SET_CURRENT_FOLDER(null)
          | ^
      191 |
      192 |       yield ref.loadSpacesTask.perform(ref)
      193 |       yield ref.loadImagesTask.perform(ref)

      at getModuleByNamespace (node_modules/vuex/dist/vuex.common.js:1136:13)
      at VueComponent.mappedMutation (node_modules/vuex/dist/vuex.common.js:989:22)
      at _callee4$ (packages/web-app-files/src/views/spaces/Projects.vue:190:1)
      at tryCatch (node_modules/regenerator-runtime/runtime.js:63:40)
      at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:293:22)
      at Generator.next (node_modules/regenerator-runtime/runtime.js:118:21)
      at getNextResult (node_modules/caf/src/caf.src.js:215:26)
  console.warn
    [vue-router] Route with name 'files-spaces-project' does not exist

      at warn (node_modules/vue-router/dist/vue-router.common.js:18:47)
      at Object.match (node_modules/vue-router/dist/vue-router.common.js:1594:9)
      at VueRouter.match (node_modules/vue-router/dist/vue-router.common.js:2940:23)
      at VueRouter.resolve (node_modules/vue-router/dist/vue-router.common.js:3094:20)
      at Proxy.render (node_modules/vue-router/dist/vue-router.common.js:1099:22)
      at node_modules/@vue/composition-api/dist/vue-composition-api.common.js:1892:35
      at activateCurrentInstance (node_modules/@vue/composition-api/dist/vue-composition-api.common.js:1842:16)

How Has This Been Tested?

  • run unit-tests locally
  • 🤖

Screenshots (if appropriate):

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:

  • ...

to get rid of these log outputs

```
  console.warn
    [vue-router] Route with name 'files-spaces-project' does not exist

      at warn (node_modules/vue-router/dist/vue-router.common.js:18:47)
      at Object.match (node_modules/vue-router/dist/vue-router.common.js:1594:9)
      at VueRouter.match (node_modules/vue-router/dist/vue-router.common.js:2940:23)
      at VueRouter.resolve (node_modules/vue-router/dist/vue-router.common.js:3094:20)
      at Proxy.render (node_modules/vue-router/dist/vue-router.common.js:1099:22)
      at node_modules/@vue/composition-api/dist/vue-composition-api.common.js:1892:35
      at activateCurrentInstance (node_modules/@vue/composition-api/dist/vue-composition-api.common.js:1842:16)
```
to get rid of these log outputs:
```
  console.error
    [vuex] module namespace not found in mapMutations(): Files/

      188 |
      189 |     const loadResourcesTask = useTask(function* (signal, ref) {
    > 190 |       ref.SET_CURRENT_FOLDER(null)
          | ^
      191 |
      192 |       yield ref.loadSpacesTask.perform(ref)
      193 |       yield ref.loadImagesTask.perform(ref)

      at getModuleByNamespace (node_modules/vuex/dist/vuex.common.js:1136:13)
      at VueComponent.mappedMutation (node_modules/vuex/dist/vuex.common.js:989:22)
      at _callee4$ (packages/web-app-files/src/views/spaces/Projects.vue:190:1)
      at tryCatch (node_modules/regenerator-runtime/runtime.js:63:40)
      at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:293:22)
      at Generator.next (node_modules/regenerator-runtime/runtime.js:118:21)
      at getNextResult (node_modules/caf/src/caf.src.js:215:26)
```
@sonarcloud
Copy link

sonarcloud bot commented Feb 10, 2022

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

Copy link
Member

@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.

LGTM 👍

@kulmann kulmann merged commit 25cc139 into master Feb 10, 2022
@delete-merged-branch delete-merged-branch bot deleted the reduceLogOutput/web-app-files/tests/unit/views/spaces/Projects.spec.js branch February 10, 2022 14:47
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.

2 participants