How to use the wilson/application.specific function in wilson

To help you get started, we’ve selected a few wilson examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chrisdickinson / wilson / tests / application.js View on Github external
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) {
github chrisdickinson / wilson / tests / application.js View on Github external
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));
    }
);