Skip to content

Commit

Permalink
add typescript test
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Dec 17, 2018
1 parent 4c227fb commit d4d0ead
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/integration/request-ts.ts
Original file line number Diff line number Diff line change
@@ -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();
});
});
};

0 comments on commit d4d0ead

Please # to comment.