Skip to content

Commit

Permalink
fix: improve app tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Mar 28, 2021
1 parent b29275d commit 614470c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/app.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ describe('app', () => {
const application = await app({ id: 284882215, include_ratings: false })
expect(application.id).toEqual(284882215)
expect(application.title).toEqual('Facebook')
done()
} catch (error) {
expect(error).toBeUndefined()
} finally {
done()
done(error)
}
})

test('should throw error on not found', async (done) => {
try {
await app({ id: '123456789' })
done(new Error(`Invalid`))
} catch (error) {
expect(error).toBeDefined()
expect(error.message).toEqual('Application not found')
} finally {
done()
}
})
Expand All @@ -33,19 +33,19 @@ describe('app', () => {
expect(application.reviews).toBeTruthy()
expect(application.histogram).toBeDefined()
expect(application.ratings).toBeDefined()
done()
} catch (error) {
expect(error).toBeUndefined()
} finally {
done()
done(error)
}
})

test('should set request options', async (done) => {
try {
await app({ id: 284882215 }, { method: 'DELETE' })
done(new Error(`Invalid`))
} catch (error) {
expect(error).toBeDefined()
} finally {
done()
}
})
Expand Down

0 comments on commit 614470c

Please sign in to comment.