Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function(assert) {
"Primary returns app instance if it is marked as primary and has the appropriate tag";
var randomTag = 'rand-'+Math.random(),
mockObject = {
'isPrimary':true,
'app':{
'provides':[randomTag],
}
};
assert.strictEqual(mockObject, application.primary(randomTag)(mockObject));
},
function(assert) {
function(assert) {
"Primary returns undefined if an app instance does not provide the tag";
var randomTag = 'rand-'+Math.random(),
otherTag = 'otherrand-'+Math.random(),
mockObject = {
'isPrimary':true,
'app':{
'provides':[randomTag],
}
};
assert.strictEqual(undefined, application.primary(otherTag)(mockObject));
},
function(assert) {
assert.throws(Error, function() {
appInstance.resolveAppDependency(application.primary(randomTag), app_dict);
});
},
function(assert) {
"Selection functions return functions that take application instances";
var randomTag = 'rand-'+Math.random();
assert.isInstance(application.any(randomTag), Function);
assert.isInstance(application.primary(randomTag), Function);
assert.isInstance(application.specific(randomTag), Function);
},
function(assert) {