Skip to content

Conversation

@heatherbshapiro
Copy link

#13 Added enable and disable functionality for Azure Functions.

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

@heatherbshapiro
Copy link
Author

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);
                });
        });
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant