Skip to content

Commit

Permalink
build: bump testcafe to 2.6.2, typescript to 4.7.4, and downstream fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
halfwhole committed Jan 2, 2024
1 parent 44dfa2e commit 429db66
Show file tree
Hide file tree
Showing 13 changed files with 2,007 additions and 1,513 deletions.
3,467 changes: 1,975 additions & 1,492 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"react-chartjs-2": "^2.11.2",
"react-dom": "^17.0.2",
"react-ga": "^3.3.0",
"react-i18next": "^11.11.1",
"react-i18next": "^11.18.6",
"react-redux": "^7.2.4",
"react-router-dom": "^5.2.0",
"react-typed": "^1.2.0",
Expand Down Expand Up @@ -163,8 +163,8 @@
"@types/upng-js": "^2.1.2",
"@types/uuid": "^8.3.1",
"@types/validator": "^13.6.2",
"@typescript-eslint/eslint-plugin": "^4.28.2",
"@typescript-eslint/parser": "^4.28.1",
"@typescript-eslint/eslint-plugin": "^6.16.0",
"@typescript-eslint/parser": "^6.16.0",
"auto-changelog": "^2.3.0",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.2.2",
Expand Down Expand Up @@ -197,11 +197,11 @@
"sequelize-mock": "^0.10.2",
"serverless-plugin-include-dependencies": "^5.0.0",
"supertest": "^6.1.3",
"testcafe": "^1.14.2",
"testcafe": "^2.6.2",
"ts-jest": "^26.5.6",
"ts-loader": "^9.2.3",
"ts-node": "^10.7.0",
"ts-node-dev": "^1.1.8",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"ts-node-dev": "^2.0.0",
"typescript": "^4.3.5",
"upng-js": "^2.1.0",
"webpack-cli": "^4.7.2",
Expand Down
1 change: 1 addition & 0 deletions src/client/app/util/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const downloadCsv = (csvString: string, filename: string) => {
})

if (useIsIE()) {
// @ts-ignore: `msSaveBlob` used for old IE versions has been removed as of TypeScript 4.4
navigator.msSaveBlob(blob, filename)
} else {
saveAs(blob, filename)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ async function downloadClicks(shortUrl: string, onError: () => void) {
})

if (useIsIE()) {
// @ts-ignore: `msSaveBlob` used for old IE versions has been removed as of TypeScript 4.4
navigator.msSaveBlob(blob, 'clicks.csv')
} else {
saveAs(blob, 'clicks.csv')
Expand Down
2 changes: 1 addition & 1 deletion src/server/modules/analytics/LinkStatisticsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class LinkStatisticsController {
res.status(200).json(linkStats)
return
} catch (error) {
res.status(404).send(jsonMessage(error.message))
res.status(404).send(jsonMessage((error as Error).message))
return
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/server/modules/audit/LinkAuditController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class LinkAuditController {
res.status(404).send(jsonMessage(error.message))
return
}
res.status(400).send(jsonMessage(error.message))
res.status(400).send(jsonMessage((error as Error).message))
return
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/server/modules/auth/LoginController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class LoginController {
await this.authService.generateOtp(email, getIp(req))
} catch (error) {
dogstatsd.increment(OTP_GENERATE_FAILURE, 1, 1)
res.serverError(jsonMessage(error.message))
res.serverError(jsonMessage((error as Error).message))
return
}

Expand Down Expand Up @@ -90,7 +90,7 @@ export class LoginController {
logger.error(`Login email not found for user:\t${email}`)
return
}
res.serverError(jsonMessage(error.message))
res.serverError(jsonMessage((error as Error).message))
return
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/server/modules/bulk/BulkController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export class BulkController {
req.body.longUrls = longUrls
next()
} catch (error) {
res.badRequest(jsonMessage(error.message, MessageType.FileUploadError))
res.badRequest(
jsonMessage((error as Error).message, MessageType.FileUploadError),
)
return
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/server/modules/job/JobController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class JobController {
} catch (error) {
dogstatsd.increment(JOB_ITEM_UPDATE_FAILURE, 1, 1)
logger.error(`error updating job item ${jobItemId}: ${error}`)
res.status(404).send(jsonMessage(error.message))
res.status(404).send(jsonMessage((error as Error).message))
return
}
next()
Expand Down Expand Up @@ -131,7 +131,7 @@ export class JobController {
res.ok(jsonMessage('User has no jobs'))
return
}
res.serverError(jsonMessage(error.message))
res.serverError(jsonMessage((error as Error).message))
}
return
}
Expand Down
8 changes: 4 additions & 4 deletions src/server/modules/threat/UrlCheckController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export class UrlCheckController {
}
} catch (error) {
dogstatsd.increment(SCAN_FAILED_LINK, 1, 1)
logger.error(error.message)
res.serverError(jsonMessage(error.message))
logger.error(error)
res.serverError(jsonMessage((error as Error).message))
return
}
}
Expand Down Expand Up @@ -82,8 +82,8 @@ export class UrlCheckController {
return
}
} catch (error) {
logger.error(error.message)
res.serverError(jsonMessage(error.message))
logger.error(error)
res.serverError(jsonMessage((error as Error).message))
return
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/server/services/sgid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ class SgidService {
})
return { url, codeVerifier, nonce }
} catch (e) {
throw new Error(`Error retrieving url via sgid-client ${e.message}`)
throw new Error(
`Error retrieving url via sgid-client: ${(e as Error).message}`,
)
}
}

Expand Down
1 change: 1 addition & 0 deletions test/end-to-end/LinkAudit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ test('Changing the link owner should update the link history with Link Owner upd
.pressKey('ctrl+a delete')
.typeText(linkTransferField, `${transferEmail}`)
.click(transferButton)
await t.wait(2000)
// Close drawer
await t.click(closeButtonSnackBar)
// Sign out
Expand Down
8 changes: 6 additions & 2 deletions test/integration/util/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export const createDbUser = async (
)
} catch (e) {
throw new Error(
`Failed to create user with email ${email} for integration tests: ${e.message}`,
`Failed to create user with email ${email} for integration tests: ${
(e as Error).message
}`,
)
}
}
Expand Down Expand Up @@ -49,7 +51,9 @@ export const deleteDbUser = async (email: string): Promise<void> => {
)
} catch (e) {
throw new Error(
`Failed to delete user with email ${email} for integration tests: ${e.message}`,
`Failed to delete user with email ${email} for integration tests: ${
(e as Error).message
}`,
)
}
}

0 comments on commit 429db66

Please sign in to comment.