| Total Complexity | 5 |
| Complexity/F | 1 |
| Lines of Code | 38 |
| Function Count | 5 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | var chai = require('chai'); |
||
| 2 | |||
| 3 | var config = require('../src/cli').config |
||
| 4 | config.set({root: __dirname + '/fixtures'}) |
||
|
|
|||
| 5 | |||
| 6 | var Hooks = require('../src/cli').Hooks; |
||
| 7 | var Plugins = require('../src/cli').Plugins; |
||
| 8 | var Manager = require('../src/cli').Manager; |
||
| 9 | var fse = require('fs-extra'); |
||
| 10 | |||
| 11 | describe('Plugin', function() { |
||
| 12 | before( function(done) { |
||
| 13 | Manager.instance.init() |
||
| 14 | .then(function () { |
||
| 15 | this.fixture = {} |
||
| 16 | done() |
||
| 17 | |||
| 18 | }.bind(this)) |
||
| 19 | }); |
||
| 20 | |||
| 21 | /** |
||
| 22 | * getRoutes |
||
| 23 | * |
||
| 24 | */ |
||
| 25 | it('getRoutes()', function() { |
||
| 26 | var routes = Plugins.instance.getRoutes() |
||
| 27 | chai.expect(routes[0].get).to.have.length(1); |
||
| 28 | }); |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Hooks.instance.trigger |
||
| 32 | * |
||
| 33 | */ |
||
| 34 | it('Hooks.instance.trigger', function() { |
||
| 35 | var res = Hooks.instance.trigger('afterEditorInput') |
||
| 36 | chai.assert.equal(res, 'test', 'Hook test failed !') |
||
| 37 | }); |
||
| 38 | }); |
||
| 39 |