azure-functions-node icon indicating copy to clipboard operation
azure-functions-node copied to clipboard

Enable disable function

Open heatherbshapiro opened this issue 8 years ago • 1 comments

#13 Added enable and disable functionality for Azure Functions.

Having issues with creating the tests - any help would be greatly appreciated :)

heatherbshapiro avatar Aug 01 '17 21:08 heatherbshapiro

I believe the test should be the following, but having trouble wiring it all up.

describe('#disableFunction-mock', function () {
        this.timeout(30000);
        it('disables an Azure Function', function () {
            var AzureFunctions = require('../index');
            var azFunctions = new AzureFunctions(nconf.get('RESOURCE_GROUP_NAME'),
                nconf.get('FUNCTION_APP_NAME'), {
                    subscriptionId: nconf.get('SUBSCRIPTION_ID'),
                    clientId: nconf.get('CLIENT_ID'),
                    clientSecret: nconf.get('CLIENT_SECRET'),
                    domain: nconf.get('AD_DOMAIN')
                });

            return azFunctions.disableFunction('unittesthttp')
                .then(func => {
                    validateFunctionObject(func);
                    assert.equal(func.properties.config.disabled, true);
                });
        });
    });

heatherbshapiro avatar Aug 01 '17 21:08 heatherbshapiro