diff --git a/test/integration/request-ts.ts b/test/integration/request-ts.ts new file mode 100644 index 00000000..00775384 --- /dev/null +++ b/test/integration/request-ts.ts @@ -0,0 +1,15 @@ +import { get } from "request"; + +const url = "https://dog.ceo/api/breeds/image/random"; + +export default () => { + return new Promise((resolve, reject) => { + get(url, { json: true }, (err, resp, body) => { + if (err) return reject(err); + if (body.status != "success") { + return reject(new Error("Bad api response: " + JSON.stringify(body))); + } + resolve(); + }); + }); +};