Skip to content

Commit

Permalink
repro: provide working example for 368
Browse files Browse the repository at this point in the history
  • Loading branch information
mefellows committed Oct 4, 2019
1 parent 3d66117 commit bfbbdf0
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions examples/mocha/test/get-dogs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe("The Dog API", () => {
afterEach(() => provider.verify())

describe("get /dogs", () => {
before(done => {
before(() => {
const interaction = {
state: "i have a list of dogs",
uponReceiving: "a request for all dogs",
Expand All @@ -53,24 +53,21 @@ describe("The Dog API", () => {
status: 200,
headers: {
"Content-Type": "application/json",
"Retry-After": "1000",
},
body: EXPECTED_BODY,
},
}
provider.addInteraction(interaction).then(() => {
done()
})
return provider.addInteraction(interaction)
})

it("returns the correct response", done => {
it("returns the correct response", async () => {
const urlAndPort = {
url: url,
port: port,
}
getMeDogs(urlAndPort).then(response => {
expect(response.data).to.eql(EXPECTED_BODY)
done()
}, done)
const response = await getMeDogs(urlAndPort)
expect(response.headers["retry-after"]).to.eql("1000")
})
})

Expand Down

0 comments on commit bfbbdf0

Please sign in to comment.