azure-functions-node
azure-functions-node copied to clipboard
Enable disable function
#13 Added enable and disable functionality for Azure Functions.
Having issues with creating the tests - any help would be greatly appreciated :)
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);
});
});
});