All files / universal/gpii/node_modules/gpii-oauth2/gpii-oauth2-datastore/test/js DataStoreTestsUtils.js

100% Statements 9/9
50% Branches 1/2
100% Functions 4/4
100% Lines 9/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31                        6x 6x   6x   6x   6x 38x   38x 24x   14x          
/*!
Copyright 2016 OCAD university
 
Licensed under the New BSD license. You may not use this file except in
compliance with this License.
 
You may obtain a copy of the License at
https://github.com/GPII/universal/blob/master/LICENSE.txt
*/
 
"use strict";
 
var fluid = fluid || require("infusion"),
    gpii = fluid.registerNamespace("gpii");
 
(function () {
 
    fluid.registerNamespace("gpii.tests.oauth2");
 
    gpii.tests.oauth2.invokePromiseProducer = function (producerFunc, args, that) {
        var promise = producerFunc.apply(null, args);
 
        promise.then(function (response) {
            that.events.onResponse.fire(response);
        }, function (err) {
            that.events.onError.fire(err);
        });
    };
 
})();