-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore (Module) Export function that either creates a RelationResolver…
… or defines an angular RelationResolverModule
- Loading branch information
Eevert Saukkokoski
committed
Sep 22, 2015
1 parent
b94c7e7
commit 60c832c
Showing
2 changed files
with
20 additions
and
2 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
module.exports = {} | ||
|
||
module.exports = (angular) -> | ||
|
||
if angular? | ||
require('./RelationResolverModule')(angular) | ||
else | ||
RelationResolver = require('./RelationResolver') | ||
new RelationResolver |
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 |
---|---|---|
@@ -1,5 +1,16 @@ | ||
require('chai').should() | ||
|
||
createRelationResolver = require('../src') | ||
|
||
describe "ag-relation-resolver root", -> | ||
it "should be defined", -> | ||
require('../src').should.exist | ||
createRelationResolver.should.exist | ||
|
||
it "is a function", -> | ||
createRelationResolver.should.be.a 'function' | ||
|
||
it 'creates a relation resolver when called without arguments', -> | ||
createRelationResolver().should.have.property('prepare').be.a 'function' | ||
|
||
it.skip 'creates an angular module and returns the module name when called with angular as an argument', -> | ||
createRelationResolver(angular).should.be.a 'string' |