Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] rest api tests fix #3466

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions packages/rest-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@synapsecns/rest-api",
"version": "1.8.14",
"version": "1.8.12",
"private": "true",
"engines": {
"node": ">=18.17.0"
Expand All @@ -23,7 +23,8 @@
"@ethersproject/providers": "^5.7.2",
"@ethersproject/units": "5.7.0",
"@synapsecns/sdk-router": "^0.11.8",
"@synapsecns/synapse-constants": "^1.8.6",
"@synapsecns/synapse-constants": "^1.8.5",
"@types/jest": "^29.5.13",
"bignumber": "^1.1.0",
"cross-fetch": "^4.0.0",
"dotenv": "^16.4.5",
Expand All @@ -34,6 +35,7 @@
"jest": "^29.7.0",
"lodash": "^4.17.21",
"supertest": "^6.3.3",
"ts-jest": "^29.2.5",
"typescript": "^5.3.3",
"winston": "^3.14.2"
},
Expand All @@ -42,18 +44,15 @@
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.4",
"@babel/preset-typescript": "^7.24.7",
"@types/jest": "^29.5.13",
"@types/supertest": "^6.0.2",
"@types/swagger-jsdoc": "^6.0.4",
"@types/swagger-ui-express": "^4.1.6",
"concurrently": "^8.2.0",
"jest": "^29.7.0",
"lodash": "^4.17.21",
"nodemon": "^3.0.1",
"swagger-jsdoc": "^6.2.8",
"swagger-merge": "^0.4.0",
"swagger-ui-express": "^5.0.1",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2"
}
}
18 changes: 9 additions & 9 deletions packages/rest-api/src/tests/bridgeRoute.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('Bridge Route with Real Synapse Service', () => {
expect(response.body.length).toBeGreaterThan(0)
expect(response.body[0]).toHaveProperty('maxAmountOutStr')
expect(response.body[0]).toHaveProperty('bridgeFeeFormatted')
}, 15000)
}, 20_000)

it('should return bridge quotes for valid originUserAddress', async () => {
const response = await request(app).get('/bridge').query({
Expand All @@ -40,7 +40,7 @@ describe('Bridge Route with Real Synapse Service', () => {
expect(response.body.length).toBeGreaterThan(0)
expect(response.body[0]).toHaveProperty('maxAmountOutStr')
expect(response.body[0]).toHaveProperty('bridgeFeeFormatted')
}, 15000)
}, 20_000)

it('should return bridge quotes for ZeroAddress', async () => {
const response = await request(app).get('/bridge').query({
Expand All @@ -55,7 +55,7 @@ describe('Bridge Route with Real Synapse Service', () => {
expect(response.body.length).toBeGreaterThan(0)
expect(response.body[0]).toHaveProperty('maxAmountOutStr')
expect(response.body[0]).toHaveProperty('bridgeFeeFormatted')
}, 15000)
}, 20_000)

it('should return bridge quotes for NativeGasAddress', async () => {
const response = await request(app).get('/bridge').query({
Expand All @@ -71,7 +71,7 @@ describe('Bridge Route with Real Synapse Service', () => {
expect(response.body.length).toBeGreaterThan(0)
expect(response.body[0]).toHaveProperty('maxAmountOutStr')
expect(response.body[0]).toHaveProperty('bridgeFeeFormatted')
}, 15000)
}, 20_000)

it('should return 400 for invalid originUserAddress', async () => {
const response = await request(app).get('/bridge').query({
Expand All @@ -88,7 +88,7 @@ describe('Bridge Route with Real Synapse Service', () => {
'message',
'Invalid originUserAddress address'
)
}, 15000)
}, 20_000)

it('should return 400 for unsupported route', async () => {
const response = await request(app).get('/bridge').query({
Expand Down Expand Up @@ -192,7 +192,7 @@ describe('Bridge Route with Real Synapse Service', () => {
expect(response.body[0].callData).toHaveProperty('to')
expect(response.body[0].callData).toHaveProperty('data')
expect(response.body[0].callData).toHaveProperty('value')
}, 15000)
}, 20_000)

it('should return bridge quotes without callData when destAddress is not provided', async () => {
const response = await request(app).get('/bridge').query({
Expand All @@ -208,7 +208,7 @@ describe('Bridge Route with Real Synapse Service', () => {
expect(Array.isArray(response.body)).toBe(true)
expect(response.body.length).toBeGreaterThan(0)
expect(response.body[0].callData).toBeNull()
}, 15000)
}, 20_000)

it('should return bridge quotes without callData when originUserAddress is not provided', async () => {
const response = await request(app).get('/bridge').query({
Expand All @@ -224,7 +224,7 @@ describe('Bridge Route with Real Synapse Service', () => {
expect(Array.isArray(response.body)).toBe(true)
expect(response.body.length).toBeGreaterThan(0)
expect(response.body[0].callData).toBeNull()
}, 15000)
}, 20_000)

it('should return 400 for invalid destAddress', async () => {
const response = await request(app).get('/bridge').query({
Expand All @@ -238,5 +238,5 @@ describe('Bridge Route with Real Synapse Service', () => {

expect(response.status).toBe(400)
expect(response.body.error).toHaveProperty('message', 'Invalid destAddress')
}, 15000)
}, 20_000)
})
Loading