contentacms / contenta_vue_nuxt

Start in minutes a Drupal 8 with JSON API and Vue.js : a Nuxt.js ( Vue.js SSR ) consumer for Contenta CMS
https://contentanuxt.now.sh
GNU General Public License v2.0
126 stars 32 forks source link

How can test one file only ? #31

Open davidjor-hpan opened 6 years ago

davidjor-hpan commented 6 years ago

https://github.com/contentacms/contenta_vue_nuxt/blob/b3224e843c67d55c8a56c01140092a930ff4c5af/test/unit/index.js#L7

This is testing all files ! I want to test specific one file only , how can I do that ?

yann-yinn commented 6 years ago

Sorry i have no time for this project for now. Please post the solution here if you find something ! I am currently looking for mainteners

alexfinnarn commented 6 years ago

@davidjor-hpan For a quick way to do this: https://webpack.js.org/guides/dependency-management/#require-context in https://github.com/contentacms/contenta_vue_nuxt/blob/b3224e843c67d55c8a56c01140092a930ff4c5af/test/unit/index.js#L5 looks for all of the files in that directory test/unit and finds files that match the /\.spec$/ regular expression. I think you can change the regular expression to match a file you want to run.

Otherwise, Karma has some docs http://karma-runner.github.io/2.0/intro/configuration.html on running tests...not a lot of info that I can see, to be honest, but I also don't know how the Webpack config fits into running the tests.

Please report back if that helps! I will start looking into the tests more as I try to complete some of these tickets.