jimdo-templateflow
Version:
jimdo template grunt workflow
67 lines (56 loc) • 2.13 kB
JavaScript
'use-strict'
var config = require('./fixtures/config.js')
var proxyquire = require('proxyquire')
describe('index', function () {
beforeEach(function () {
this.grunt = {
config: {
merge: function (_) { return; }
},
task: {
run: function (_) { return; }
},
registerTask: function (_, _) { return; }
}
this.index = proxyquire('../index.js', {
'load-grunt-tasks': function (_, _) { return; },
'./config/config.js': function () { return config; },
'./config/gruntConfig.js': function () { return { property: 'value' }; }
})
})
it('does call grunt merge method with config', function () {
spyOn(this.grunt.config, 'merge')
this.index(this.grunt)
expect(this.grunt.config.merge.calls.argsFor(0)).toEqual([{ property: 'value' }])
})
it('does register a task called compile', function () {
spyOn(this.grunt, 'registerTask')
this.index(this.grunt)
expect(this.grunt.registerTask).toHaveBeenCalledWith('compile', jasmine.anything())
})
it('does register a task called serve', function () {
spyOn(this.grunt, 'registerTask')
this.index(this.grunt)
expect(this.grunt.registerTask).toHaveBeenCalledWith('serve', jasmine.anything())
})
it('does register a task called build', function () {
spyOn(this.grunt, 'registerTask')
this.index(this.grunt)
expect(this.grunt.registerTask).toHaveBeenCalledWith('build', jasmine.anything())
})
it('does register a task called deploy', function () {
spyOn(this.grunt, 'registerTask')
this.index(this.grunt)
expect(this.grunt.registerTask).toHaveBeenCalledWith('deploy', jasmine.anything())
})
it('does register a task called release', function () {
spyOn(this.grunt, 'registerTask')
this.index(this.grunt)
expect(this.grunt.registerTask).toHaveBeenCalledWith('release', jasmine.anything())
})
it('does register a task called prerelease', function () {
spyOn(this.grunt, 'registerTask')
this.index(this.grunt)
expect(this.grunt.registerTask).toHaveBeenCalledWith('prerelease', jasmine.anything())
})
})