Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
instance.teardown(function () {
methods(HostedFields.prototype).concat(methods(EventEmitter.prototype))
.forEach(function (method) {
var error;
try {
instance[method]();
} catch (err) {
error = err;
}
expect(error).to.be.an.instanceof(BraintreeError);
expect(error.type).to.equal(BraintreeError.types.MERCHANT);
expect(error.code).to.equal('METHOD_CALLED_AFTER_TEARDOWN');
expect(error.message).to.equal(method + ' cannot be called after teardown.');
});
done();
ThreeDSecure.prototype.teardown = function () {
var methodNames = methods(ThreeDSecure.prototype).concat(methods(EventEmitter.prototype));
convertMethodsToError(this, methodNames);
return this._framework.teardown();
};
this._destructor.registerFunctionForTeardown(function () {
var methodNames = methods(HostedFields.prototype).concat(methods(EventEmitter.prototype));
convertMethodsToError(self, methodNames);
});
}