fixup tests

Note that these tests aren’t currently passing on master either; the
last PR only passed because travis didn’t actually run the tests:
https://travis-ci.org/DefinitelyTyped/DefinitelyTyped/builds/160110579
This commit is contained in:
Ethan Resnick
2016-09-19 23:05:24 -04:00
parent 92b7191938
commit b434572f41
+7 -2
View File
@@ -1,4 +1,5 @@
import * as twilio from './twilio';
import * as Express from "express";
// Examples taken from https://twilio.github.io/twilio-node/ (v2.1.0)
@@ -227,8 +228,12 @@ var token = capability.generate(120);
/// Utilities
twilio.validateRequest(token, str, 'http://example.herokuapp.com', { query: 'val' });
twilio.validateExpressRequest({}, 'YOUR_TWILIO_AUTH_TOKEN');
twilio.validateExpressRequest({}, 'YOUR_TWILIO_AUTH_TOKEN', {});
twilio.validateExpressRequest(getMockExpressRequest(), 'YOUR_TWILIO_AUTH_TOKEN');
twilio.validateExpressRequest(getMockExpressRequest(), 'YOUR_TWILIO_AUTH_TOKEN', {});
twilio.webhook({ validate: false });
twilio.webhook("MYAUTHTOKEN", { validate: false });
function getMockExpressRequest(): Express.Request {
return <Express.Request>JSON.parse("{}");
}