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) {
"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) {
function(assert) {
"Specific returns an app that is specifically named, regardless of tag";
var randomTag = 'rand-'+Math.random(),
randomName = 'otherrand-'+Math.random(),
mockObject = {
'name':randomName,
'app':{
'provides':[randomTag],
}
};
assert.strictEqual(mockObject, application.specific(randomName)(mockObject));
mockObject.name = Math.random() + "NOOO";
assert.strictEqual(undefined, application.specific(randomName)(mockObject));
}
);