Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nigamshirish's avatar

VueJS/Vuex Testing of Component built using Spark

I'm using Mocha/Chai/Avoriaz to test my Vue Components that are using data provided by Spark Global Variable.

Test runs fine on plain component that's not using Spark Data. So, I'm confident that my test setup is working as it should.

But when I try running tests on components built utilising Vuex Store,

import * as types from '../mutation-types'
const state = {
    data: Spark.orders,
}

...I get `ReferenceError: Spark is not defined' error.

Can anyone point me in the right direction please?

0 likes
0 replies

Please or to participate in this conversation.