Closed Loremaster closed 4 years ago
As a fine contributor added just yesterday to the README file, you should add this library to the included transpilation in order to use it. You can see the instruction inside the readme.
Comment here if you still encounter the problem. I keep this issue open until then.
Wow thank you for such quick reply!
This is what I did and it helped:
module.exports = {
transformIgnorePatterns: ["node_modules/(?!vee-validate/dist/rules|vuex-composition-helpers)"],
};
👯
Thanks for the compliments! :)
BTW, this package made as part of an opensource project called "Greenpress", which is a fully-alternative for WordPress, built for the 21st century (micro-services, node, Vue, Nuxt, and other great stuff).
If you want to become a part of a fun opensource, you're more than welcome to contribute or to use it for yourself. Start here and see for yourself: https://github.com/greenpress/greenpress
Have a nice day :)
@Loremaster @davidmeirlevy Hi ! I have been struggling to make my Jest test pass. Here is my jest.config :
module.exports = {
preset: '@vue/cli-plugin-unit-jest',
setupFiles: ['<rootDir>/tests/setupTest.js'],
modulePaths: [
'<rootDir>/src',
],
moduleFileExtensions: ['js', 'json', 'vue', 'ts'],
moduleDirectories: ['node_modules', 'src'],
transform: {
'.+\\.(js|ts)$': '<rootDir>/node_modules/babel-jest',
},
transformIgnorePatterns: ['/node_modules/(?!(vuex-composition-helpers)/)'],
}`
I use JavaScript in my project and I added:
chainWebpack: config => { config .rule('ts') .include .add(/vuex-composition-helpers/) },
and
transpileDependencies: [ 'vuex-composition-helpers', ],
to my vue.config.js.
The issue is that when I run my test I get a syntax error from the vuex-composition-helpers global.ts file. Do you see anything missing to make this work?
@jordanA29 you can avoid transpiling the TS files and just import vuex-composition-helpers/dist
which is an already-transpiled methods.
Hey!
Thank you for your library! It's really helpful when you use vue composition api. However I am trying to find a way to test it properly. Currently jest raises an error for me:
My jest config: