chore(integration): throw errors on catch blocks (#2091)
Why: Suppressing errors and not failing the execution will lead to misleading errors of the following tests. Fixes CORE-461
This commit is contained in:
committed by
GitHub
parent
5a964e6439
commit
ffd6234356
@@ -27,23 +27,18 @@ describe("/admin/regions", () => {
|
||||
|
||||
describe("Remove region from country on delete", () => {
|
||||
beforeEach(async () => {
|
||||
try {
|
||||
await adminSeeder(dbConnection)
|
||||
const manager = dbConnection.manager
|
||||
await manager.insert(Region, {
|
||||
id: "test-region",
|
||||
name: "Test Region",
|
||||
currency_code: "usd",
|
||||
tax_rate: 0,
|
||||
})
|
||||
await adminSeeder(dbConnection)
|
||||
const manager = dbConnection.manager
|
||||
await manager.insert(Region, {
|
||||
id: "test-region",
|
||||
name: "Test Region",
|
||||
currency_code: "usd",
|
||||
tax_rate: 0,
|
||||
})
|
||||
|
||||
await manager.query(
|
||||
`UPDATE "country" SET region_id='test-region' WHERE iso_2 = 'us'`
|
||||
)
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
throw err
|
||||
}
|
||||
await manager.query(
|
||||
`UPDATE "country" SET region_id='test-region' WHERE iso_2 = 'us'`
|
||||
)
|
||||
})
|
||||
|
||||
afterEach(async () => {
|
||||
@@ -203,23 +198,18 @@ describe("/admin/regions", () => {
|
||||
|
||||
describe("DELETE /admin/regions/:id", () => {
|
||||
beforeEach(async () => {
|
||||
try {
|
||||
await adminSeeder(dbConnection)
|
||||
const manager = dbConnection.manager
|
||||
await manager.insert(Region, {
|
||||
id: "test-region",
|
||||
name: "Test Region",
|
||||
currency_code: "usd",
|
||||
tax_rate: 0,
|
||||
})
|
||||
await adminSeeder(dbConnection)
|
||||
const manager = dbConnection.manager
|
||||
await manager.insert(Region, {
|
||||
id: "test-region",
|
||||
name: "Test Region",
|
||||
currency_code: "usd",
|
||||
tax_rate: 0,
|
||||
})
|
||||
|
||||
await manager.query(
|
||||
`UPDATE "country" SET region_id='test-region' WHERE iso_2 = 'us'`
|
||||
)
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
throw err
|
||||
}
|
||||
await manager.query(
|
||||
`UPDATE "country" SET region_id='test-region' WHERE iso_2 = 'us'`
|
||||
)
|
||||
})
|
||||
|
||||
afterEach(async () => {
|
||||
|
||||
Reference in New Issue
Block a user