Closed lee-chase closed 5 years ago
A test Vue CLI project would indicate Jest with Vue-test-utils is the way to go.
This would give us a very similar setup to carbon-components-react and may allow us to copy some tests.
I believe it's also well worth using snapshot verification, as also demonstrated in https://github.com/vuejs/vue-test-utils-jest-example
See https://github.com/carbon-design-system/carbon-components-vue/tree/add-tests
Where it could be me, my machine or something fundamentally wrong with how tests have been added.
NOTE: Adding Jest unit tests through the Vue CLI usually installs babel-core@.0.0-bridge.0 but this seems to kill the storybook build which uses @babel/core.
Must be able to run yarn tasks; storybook-build, storybook, build and test:unit in order to merge into master.
The current problem when running the test.
It would appear that downgrading to v10 of node (the current version) fixes this issue.
Credit to @sabov for spotting this
The library does not currently run any tests during compilation, introduce a testing system to the library.
NOTE: It is not expected that tests for the whole library are added. Testing as part of the build for one component and documentation as to how tests are added to components.
SEE: React and Angular test implemenations for possible patterns to follow.