Skip to content

Commit

Permalink
test: update to test uploading a source code
Browse files Browse the repository at this point in the history
The `adm-zip` has some flaw so we cannot generate good JS files (see
cthackers/adm-zip#526). Therefore I do a
patch. We should remove the patch once the issue is fixed.
  • Loading branch information
wdzeng committed Aug 16, 2024
1 parent 5d6209a commit 27cbc7b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ function updateVersionAndSaveZip(zipPath: string): void {
const minute = now.getMinutes()
const seconds = now.getSeconds()
const version = `${year.toString().slice(-2)}.${month}${toTwoDigit(date)}.${hour}${toTwoDigit(minute)}.${seconds}`
core.debug(`Set version to ${version}`)

// @ts-expect-error: JSON.parse accepts buffer.
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
Expand Down Expand Up @@ -63,7 +62,16 @@ async function main() {
const uuid = await uploadXpi(xpiPath, jwtToken, selfHosted)
const approvalNotes = 'general update'
const releaseNotes = { 'zh-TW': 'improve performance' }
await updateAddon(addonGuid, license, uuid, jwtToken, approvalNotes, releaseNotes)
await updateAddon(
addonGuid,
license,
uuid,
jwtToken,
approvalNotes,
releaseNotes,
xpiPath, // Let the source code file be the same as the xpi file in this test.
xpiPath
)
} catch (e: unknown) {
// The test will exit with non-zero code.
handleError(e)
Expand Down

0 comments on commit 27cbc7b

Please sign in to comment.