chai-angular-injectable

0.0.2 • Public • Published

chai-angular-injectable

Check a function can be safely used with Angular 1 dependency injector.

Support inline Array annotation and property annotation.

Install

npm install --save-dev mocha chai chai-angular-injectable

Usage

Register the plugin:

const chai = require('chai');
const injectableChai = require('./index.js');
 
chai.use(injectableChai);

Test your farctory, service and controllers:

var SomeCtrl = ['foo', function(foo) {}];
var fooFactory = function($log) {};
 
fooFactory.$inject = ['$log'];
 
describe('SomeCtrl', function() {
 
  it('should be injectable', function() {
    expect(SomeCtrl).to.be.injectable;
  });
 
});
 
describe('fooFactory', function() {
 
  it('should be injectable', function() {
    expect(fooFactory).to.be.injectable;
  });
 
});

Readme

Keywords

Package Sidebar

Install

npm i chai-angular-injectable

Weekly Downloads

3

Version

0.0.2

License

MIT

Last publish

Collaborators

  • dinoboff
  • singpath