AngularJS test generator for Jasmine and ES6
npm install angularjs-test-generatorThis is a simple CLI application to facilitate the creation of Jasmine test for AngularJS
 
Via git:
``shell `
git clone git+https://github.com/LuisEGR/angularjs-test-generator.git
cd angularjs-test-generator
npm install -g
Vía npm:
`shell `
npm install -g angularjs-test-generator
Simply go to the directory of your component, which must have these files:
./module.js
./controller.js
* ./view.html
and at least one of this:
* ./directive.js
* ./component.js
`shell`
cd myApp/components/my-component/
gentest
this will create the file `component.spec.js`
#### CLI Arguments
argument | defualt | description | example
--- | --- | --- | ---
-o | component.spec.js | destination file | gentest -o spec/myout.spec.js
---Attention!
This script requires you to have your project with this configuration:
- Webpack module builder
- ES6 Project, with ES6 modules (babel-preset-env^)
- Karma test runner
---
- [x] Components
- [x] module name from module.jsfolder-name
- [x] htmlTag -> html-tag from controller.js
- [x] controller functions (starting with vm.) from component.js
- [x] bindings ('<', '&', '@') from view.html
- [x] templateCache on fixtures.js`
- [x] testData on
- [x] Directives -> Element, Attribute
- [ ] Filters
- [ ] Services
If you have any problem with this script please open a new issue describing the problem and how to replicate it.