mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
update server tests
This commit is contained in:
parent
85ffae37d1
commit
414dcd455a
@ -13,9 +13,22 @@ describe('GET /', () => {
|
||||
})
|
||||
|
||||
describe('POST /api/v1/urlcheck', () => {
|
||||
it('responds with json', async () => {
|
||||
const response = await request(server).post('/api/v1/urlcheck')
|
||||
it('responds with json on http://', async () => {
|
||||
const response = await request(server)
|
||||
.post('/api/v1/urlcheck')
|
||||
.send({ url: 'https://oceanprotocol.com/tech-whitepaper.pdf' })
|
||||
expect(response.status).toBe(200)
|
||||
expect(response.body).toBeTruthy()
|
||||
})
|
||||
|
||||
it('responds with json on ipfs://', async () => {
|
||||
const response = await request(server)
|
||||
.post('/api/v1/urlcheck')
|
||||
.send({
|
||||
url: 'ipfs://QmQfpdcMWnLTXKKW9GPV7NgtEugghgD6HgzSF6gSrp2mL9'
|
||||
})
|
||||
expect(response.status).toBe(200)
|
||||
expect(response.body).toBeTruthy()
|
||||
})
|
||||
|
||||
it('responds with error message when url is missing', async () => {
|
||||
|
Loading…
Reference in New Issue
Block a user