This repository has been archived by the owner on Mar 26, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(templates): add provider test scafolding
WIP
- Loading branch information
1 parent
1343363
commit 7ec5f63
Showing
3 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use strict' | ||
|
||
describe 'Service: <%= cameledName %>', -> | ||
|
||
# instantiate service | ||
<%= cameledName %> = {} | ||
init = -> | ||
inject (_<%= cameledName %>_) -> | ||
<%= cameledName %> = _<%= cameledName %>_ | ||
return | ||
return | ||
|
||
# load the service's module | ||
beforeEach module '<%= scriptAppName %>' | ||
|
||
it 'should do something', -> | ||
init() | ||
expect(!!<%= cameledName %>).toBe true | ||
return | ||
|
||
it 'should be configurable', -> | ||
module (<%= cameledName %>Provider) -> | ||
<%= cameledName %>Provider.setSalutation 'Lorem ipsum' | ||
return | ||
|
||
init() | ||
|
||
expect(<%= cameledName %>.greet()).toEqual 'Lorem ipsum' | ||
return | ||
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
'use strict'; | ||
|
||
describe('Service: <%= cameledName %>', function () { | ||
|
||
// instantiate service | ||
var <%= cameledName %>, | ||
init = function () { | ||
inject(function (_<%= cameledName %>_) { | ||
<%= cameledName %> = _<%= cameledName %>_; | ||
}); | ||
}; | ||
|
||
// load the service's module | ||
beforeEach(module('<%= scriptAppName %>')); | ||
|
||
it('should do something', function () { | ||
init(); | ||
|
||
expect(!!<%= cameledName %>).toBe(true); | ||
}); | ||
|
||
it('should be configurable', function () { | ||
module(function (<%= cameledName %>Provider) { | ||
<%= cameledName %>Provider.setSalutation('Lorem ipsum'); | ||
}); | ||
|
||
init(); | ||
|
||
expect(<%= cameledName %>.greet()).toEqual('Lorem ipsum'); | ||
}); | ||
|
||
}); |