Guest User

Untitled

a guest
Mar 21st, 2018
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. # This is my log of what is currently working with my extension of
  2. # the quasar-cli to include unit testing.
  3. # It is
  4.  
  5.  
  6. ###########
  7. quasar init test
  8.  
  9. # creates normally without errors (except these warnings - this is actually done before I link)
  10. warning " > eslint-config-standard@10.2.1" has incorrect peer dependency "eslint-plugin-promise@>=3.5.0".
  11. warning " > eslint-loader@1.7.1" has incorrect peer dependency "eslint@>=1.6.0 <4.0.0".
  12.  
  13.  
  14. # quasar mode -r|-a pwa|cordova|electron|test
  15. quasar mode --add test # if not in right folder
  16. app:paths Error. This command must be executed inside a Quasar Project folder. +0ms
  17.  
  18. ok
  19. quasar mode --add test # (creates /test folder and clones contents from /templates/)
  20. app:mode-test Creating Unit Test source folder... +18s
  21. app:mode-test Unit Test support was added +4ms
  22. # if run a second time:
  23. app:mode-test Test support detected. Aborting. +0ms
  24.  
  25.  
  26. quasar mode --remove test # (irrevocably removes $quasarApp/test folder and all contents
  27. # TODO: ask for confirmation)
  28. app:mode-test Unit Test support was removed +9s
  29. # if run a second time:
  30. app:mode-test No Test support detected. Aborting. +0ms
  31.  
  32.  
  33. # quasar new [t|test] <test_name>
  34. # this clones another test-template into the Quasar App /test folder
  35. quasar new test "testy"
  36. app:new Generated test: test/testy.js +0ms
  37. app:new Make sure to reference it in test/test.js +3ms
  38.  
  39. quasar dev --mode test
  40. # Builds - not showing tests yet.
  41.  
  42. quasar test testy.js
  43.  
  44. "test": "cross-env NODE_ENV=test nyc mocha-webpack --webpack-config templates/unit_test/webpack.config.js --require templates/unit_test/setup.js templates/unit_test/**/*.spec.js"
  45. "test": "mocha --reporter spec templates/app/test.js"
  46.  
  47. ---- needed
  48. "@vue/test-utils": "^1.0.0-beta.12",
  49. "babel-plugin-coverage": "^1.0.0",
  50. "cross-env": "^5.1.4",
  51. "expect": "^22.4.0",
  52. "jsdom": "^11.6.2",
  53. "jsdom-global": "^3.0.2",
  54. "nyc": "^11.4.1",
  55. "vue-server-renderer": "^2.5.15",
  56. "vue-template-compiler": "2.5.14",
  57. "webpack-merge": "4.1.2",
  58. "webpack-node-externals": "^1.6.0"
  59.  
  60. {
  61. test: 'test/*.js', // /test\.js$/,
  62. use: 'mocha-loader',
  63. exclude: /node_modules/,
  64. },
  65.  
  66. if (process.env.NODE_ENV === 'test') {
  67. // exclude NPM deps from test bundle
  68. module.exports.externals = [require('webpack-node-externals')()]
  69. // use inline source map so that it works with mocha-webpack
  70. module.exports.devtool = 'inline-cheap-module-source-map'
  71. }
  72.  
  73. quasar dev --mode test
  74. -- actually installs test mode!!! how cool is that!!!
Add Comment
Please, Sign In to add comment