Skip to content
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.

Create a dedicated spec file for factories #484

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion factory/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ util.inherits(Generator, ScriptBase);
Generator.prototype.createServiceFiles = function createServiceFiles() {
this.generateSourceAndTest(
'service/factory',
'spec/service',
'spec/factory',
'services',
this.options['skip-add'] || false
);
Expand Down
14 changes: 14 additions & 0 deletions templates/coffeescript-min/spec/factory.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict'

describe 'Service: <%= cameledName %>', () ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this maybe also say Factory then?


# load the service's module
beforeEach module '<%= scriptAppName %>'

# instantiate service
<%= cameledName %> = {}
beforeEach inject (_<%= cameledName %>_) ->
<%= cameledName %> = _<%= cameledName %>_

it 'should do something', () ->
expect(!!<%= cameledName %>).toBe true
14 changes: 14 additions & 0 deletions templates/coffeescript/spec/factory.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict'

describe 'Service: <%= cameledName %>', () ->

# load the service's module
beforeEach module '<%= scriptAppName %>'

# instantiate service
<%= cameledName %> = {}
beforeEach inject (_<%= cameledName %>_) ->
<%= cameledName %> = _<%= cameledName %>_

it 'should do something', () ->
expect(!!<%= cameledName %>).toBe true
18 changes: 18 additions & 0 deletions templates/javascript-min/spec/factory.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';

describe('Service: <%= cameledName %>', function () {

// load the service's module
beforeEach(module('<%= scriptAppName %>'));

// instantiate service
var <%= cameledName %>;
beforeEach(inject(function(_<%= cameledName %>_) {
<%= cameledName %> = _<%= cameledName %>_;
}));

it('should do something', function () {
expect(!!<%= cameledName %>).toBe(true);
});

});
18 changes: 18 additions & 0 deletions templates/javascript/spec/factory.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';

describe('Service: <%= cameledName %>', function () {

// load the service's module
beforeEach(module('<%= scriptAppName %>'));

// instantiate service
var <%= cameledName %>;
beforeEach(inject(function (_<%= cameledName %>_) {
<%= cameledName %> = _<%= cameledName %>_;
}));

it('should do something', function () {
expect(!!<%= cameledName %>).toBe(true);
});

});