[Vuejs]-How can I test action in vuex with vue-test-utils and jest when this actions uses a globalProperties?

0👍

Judging by the error it your dashboards object which is not defined.

I don’t know how you create it or what it is, but if you want to try to mock in Vue-test-utils config file please note that global doesn’t seem to be a valid config option, you might want to try:

config.mocks = {
  global: {
    dashboards: {
      $filters: {
        translate: (msg) => msg,
        currency: (currency) => currency
      },
      $t: (text) => text
    }
  }

}

Alternatively Jest provide a way to define global variables that need to be available in all test in jest.config.js:

// globals: {},

Leave a comment