angularjs-test-generator

0.0.10 • Public • Published

AngularJS Jasmine test generator

This is a simple CLI application to facilitate the creation of Jasmine test for AngularJS

npm version Known Vulnerabilities

Instalation

Via git:

git clone git+https://github.com/LuisEGR/angularjs-test-generator.git
cd angularjs-test-generator
npm install -g

Vía npm:

npm install -g angularjs-test-generator

Use

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
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

TODO

  • Components
    • module name from module.js
    • htmlTag -> html-tag from folder-name
    • controller functions (starting with vm.) from controller.js
    • bindings ('<', '&', '@') from component.js
    • templateCache on view.html
    • testData on fixtures.js
  • 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.

Package Sidebar

Install

npm i angularjs-test-generator

Weekly Downloads

1

Version

0.0.10

License

MIT

Last publish

Collaborators

  • luisegr