Skip to content

Commit

Permalink
feat: fix tests and types
Browse files Browse the repository at this point in the history
  • Loading branch information
delanni committed Jun 26, 2023
1 parent cc5fde4 commit 4433f5d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,7 @@
"@types/mustache": "^0.8.31",
"@types/nock": "^10.0.3",
"@types/node": "18.16.18",
"@types/node-fetch": "^2.6.0",
"@types/node-fetch": "2.6.4",
"@types/node-forge": "^1.3.1",
"@types/nodemailer": "^6.4.0",
"@types/normalize-path": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/dev/build/lib/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export async function downloadToDisk({
const downloadedSha = hash.digest('hex');
if (downloadedSha !== shaChecksum) {
throw new Error(
`Downloaded checksum ${downloadedSha} does not match the expected ${shaChecksum} (${shaAlgorithm}) checksum, for file: ${url}`
`Downloaded checksum ${downloadedSha} does not match the expected (${shaAlgorithm}) checksum ${shaChecksum}, for file: ${url}.`
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/dev/build/lib/integration_tests/download.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe('downloadToDisk', () => {
shaAlgorithm: 'sha256',
});
await expect(promise).rejects.toMatchInlineSnapshot(
`[Error: Downloaded checksum 2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae does not match the expected sha256 checksum.]`
`[Error: Downloaded checksum ${FOO_SHA256} does not match the expected (sha256) checksum bar, for file: ${serverUrl}.]`
);

try {
Expand Down Expand Up @@ -175,7 +175,7 @@ describe('downloadToDisk', () => {
" info Retrying in 0.1 seconds",
" debg [2/3] Attempting download of TEST_SERVER_URL sha256",
" debg Downloaded 3 bytes to TMP_DIR/__tmp_download_js_test_file__",
" debg Download failed: Downloaded checksum fcde2b2edba56bf408601fb721fe9b5c338d10ee429ea04fae5511b68fbf8fb9 does not match the expected sha256 checksum.",
" debg Download failed: Downloaded checksum fcde2b2edba56bf408601fb721fe9b5c338d10ee429ea04fae5511b68fbf8fb9 does not match the expected (sha256) checksum 2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae, for file: TEST_SERVER_URL.",
" debg Deleting downloaded data at TMP_DIR/__tmp_download_js_test_file__",
" info Retrying in 0.2 seconds",
" debg [3/3] Attempting download of TEST_SERVER_URL sha256",
Expand Down
10 changes: 9 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9003,7 +9003,15 @@
dependencies:
"@types/node" "*"

"@types/node-fetch@^2.5.7", "@types/node-fetch@^2.6.0":
"@types/[email protected]":
version "2.6.4"
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.4.tgz#1bc3a26de814f6bf466b25aeb1473fa1afe6a660"
integrity sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg==
dependencies:
"@types/node" "*"
form-data "^3.0.0"

"@types/node-fetch@^2.5.7":
version "2.6.2"
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.2.tgz#d1a9c5fd049d9415dce61571557104dec3ec81da"
integrity sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==
Expand Down

0 comments on commit 4433f5d

Please sign in to comment.