Files
DefinitelyTyped/types/q-retry/q-retry-tests.ts
2017-03-24 14:27:52 -07:00

42 lines
629 B
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Q = require('q-retry');
Q
.retry(() => {
return '';
})
.then(str => {
str.charAt;
return 0;
})
.retry(num => {
num.toFixed;
})
.retry(() => {
}, 5)
.retry(() => {
}, (reason, retries) => {
retries.toFixed;
})
.retry(() => {
}, (reason, retries) => {
retries.toFixed;
}, 10)
.retry(() => {
return '';
}, (reason, retries) => {
}, {
limit: 10,
interval: 1000,
maxInterval: 20000,
intervalMultiplier: 1.5
})
.then(str => {
str.charAt;
});