Skip to content

Commit

Permalink
(fix): use product API endpoint to fetch latest release by platform (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann authored Feb 13, 2024
1 parent c3925da commit f735947
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const BASE_CDN_URL = (
'https://msedgedriver.azureedge.net'
)
export const DOWNLOAD_URL = `${BASE_CDN_URL}/%s/%s.zip`
export const EDGE_PRODUCTS_API = 'https://edgeupdates.microsoft.com/api/products'
export const TAGGED_VERSION_URL = `${BASE_CDN_URL}/LATEST_%s`
export const LATEST_RELEASE_URL = `${BASE_CDN_URL}/LATEST_RELEASE_%s_%s`
export const BINARY_FILE = 'msedgedriver' + (os.platform() === 'win32' ? '.exe' : '')
Expand Down
43 changes: 39 additions & 4 deletions src/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,18 @@ import fetch from 'node-fetch'
import unzipper, { type Entry } from 'unzipper'

import findEdgePath from './finder.js'
import { TAGGED_VERSIONS, TAGGED_VERSION_URL, LATEST_RELEASE_URL, DOWNLOAD_URL, BINARY_FILE, log } from './constants.js'
import { TAGGED_VERSIONS, EDGE_PRODUCTS_API, TAGGED_VERSION_URL, LATEST_RELEASE_URL, DOWNLOAD_URL, BINARY_FILE, log } from './constants.js'
import { hasAccess, getNameByArchitecture, sleep } from './utils.js'

interface ProductAPIResponse {
Product: string
Releases: {
Platform: string
Architecture: string
ProductVersion: string
}[]
}

export async function download (
edgeVersion: string = process.env.EDGEDRIVER_VERSION,
cacheDir: string = process.env.EDGEDRIVER_CACHE_DIR || os.tmpdir()
Expand Down Expand Up @@ -74,6 +83,9 @@ async function getEdgeVersionUnix (edgePath: string) {
}

export async function fetchVersion (edgeVersion: string) {
const p = os.platform()
const platform = p === 'win32' ? 'win' : p === 'darwin' ? 'mac' : 'linux'

/**
* if version has 4 digits it is a valid version, e.g. 109.0.1467.0
*/
Expand All @@ -85,6 +97,31 @@ export async function fetchVersion (edgeVersion: string) {
* if browser version is a tagged version, e.g. stable, beta, dev, canary
*/
if (TAGGED_VERSIONS.includes(edgeVersion.toLowerCase())) {
const apiResponse = await fetch(EDGE_PRODUCTS_API).catch((err) => {
log.error(`Couldn't fetch version from ${EDGE_PRODUCTS_API}: ${err.stack}`)
return { json: async () => [] as ProductAPIResponse[] }
})
const products = await apiResponse.json() as ProductAPIResponse[]
const product = products.find((p) => p.Product.toLowerCase() === edgeVersion.toLowerCase())
const productVersion = product?.Releases.find((r) => (
/**
* On Mac we all product versions are universal to its architecture
*/
(platform === 'mac' && r.Platform === 'MacOS') ||
/**
* On Windows we need to check for the architecture
*/
(platform === 'win' && r.Platform === 'Windows' && os.arch() === r.Architecture) ||
/**
* On Linux we only have one architecture
*/
(platform === 'linux' && r.Platform === 'Linux')
))?.ProductVersion

if (productVersion) {
return productVersion
}

const res = await fetch(format(TAGGED_VERSION_URL, edgeVersion.toUpperCase()))
return (await res.text()).replace(/\0/g, '').slice(2).trim()
}
Expand All @@ -95,9 +132,7 @@ export async function fetchVersion (edgeVersion: string) {
const MATCH_VERSION = /\d+/g
if (edgeVersion.match(MATCH_VERSION)) {
const [major] = edgeVersion.match(MATCH_VERSION)
const p = os.platform()
const arch = p === 'win32' ? 'win' : p === 'darwin' ? 'mac' : 'linux'
const url = format(LATEST_RELEASE_URL, major.toString().toUpperCase(), arch.toUpperCase())
const url = format(LATEST_RELEASE_URL, major.toString().toUpperCase(), platform.toUpperCase())
const res = await fetch(url)
return (await res.text()).replace(/\0/g, '').slice(2).trim()
}
Expand Down
1 change: 1 addition & 0 deletions tests/__fixtures__/api.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"Product":"Stable","Releases":[{"ReleaseId":67360,"Platform":"iOS","Architecture":"arm64","CVEs":[],"ProductVersion":"121.0.2277.107","Artifacts":[],"PublishedTime":"2024-02-06T02:42:00","ExpectedExpiryDate":"2025-02-06T02:42:00"},{"ReleaseId":67361,"Platform":"Android","Architecture":"arm64","CVEs":[],"ProductVersion":"121.0.2277.105","Artifacts":[],"PublishedTime":"2024-02-06T05:34:00","ExpectedExpiryDate":"2024-05-06T05:34:00"},{"ReleaseId":67537,"Platform":"Windows","Architecture":"x64","CVEs":[],"ProductVersion":"121.0.2277.112","Artifacts":[{"ArtifactName":"msi","Location":"https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/27140695-6d81-49af-a1f8-a388751f9eb3/MicrosoftEdgeEnterpriseX64.msi","Hash":"85D49E19D40B5F4C3D61C4C436D7EFF6EFC05378CBACEDAD48DD43CC0266D5B6","HashAlgorithm":"SHA256","SizeInBytes":180793344}],"PublishedTime":"2024-02-10T09:00:00","ExpectedExpiryDate":"2025-02-08T19:19:00"},{"ReleaseId":67539,"Platform":"Windows","Architecture":"arm64","CVEs":[],"ProductVersion":"121.0.2277.112","Artifacts":[{"ArtifactName":"msi","Location":"https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/d1405651-636c-4cdc-9e54-8136daa1d1d0/MicrosoftEdgeEnterpriseARM64.msi","Hash":"DA0AFD9EA302D5DA12DBB4B9F816F2B5FD532974A228876536EC15594DAA6614","HashAlgorithm":"SHA256","SizeInBytes":177016832}],"PublishedTime":"2024-02-10T08:57:00","ExpectedExpiryDate":"2025-02-08T19:21:00"},{"ReleaseId":67544,"Platform":"Windows","Architecture":"x86","CVEs":[],"ProductVersion":"121.0.2277.112","Artifacts":[{"ArtifactName":"msi","Location":"https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/01960b14-a9c7-40cb-b3ac-af71266eb2ac/MicrosoftEdgeEnterpriseX86.msi","Hash":"4647C4AFEEFDCE795027B7461079BE0B39F149B4011453208D016DE5B22104D3","HashAlgorithm":"SHA256","SizeInBytes":161099776}],"PublishedTime":"2024-02-10T08:58:00","ExpectedExpiryDate":"2025-02-08T19:27:00"},{"ReleaseId":67557,"Platform":"Linux","Architecture":"x64","CVEs":[],"ProductVersion":"121.0.2277.113","Artifacts":[{"ArtifactName":"rpm","Location":"https://packages.microsoft.com/yumrepos/edge/microsoft-edge-stable-121.0.2277.113-1.x86_64.rpm","Hash":"CA11CF285514C23994153970EC3B5FE3B4CAD784D166228BBE104FAA30AA5377","HashAlgorithm":"SHA256","SizeInBytes":168006120},{"ArtifactName":"deb","Location":"https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_121.0.2277.113-1_amd64.deb","Hash":"55B58CD310BD3A5BA64DFDE50618DDE6D764231D921903DFDEB8629FEAEB42F0","HashAlgorithm":"SHA256","SizeInBytes":165778994}],"PublishedTime":"2024-02-08T19:49:00","ExpectedExpiryDate":"2025-02-08T19:49:00"},{"ReleaseId":67558,"Platform":"MacOS","Architecture":"universal","CVEs":[],"ProductVersion":"121.0.2277.112","Artifacts":[{"ArtifactName":"plist","Location":"https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/33e1fbf1-5ce4-4360-aba9-9a2ee8f24039/MicrosoftEdge-121.0.2277.112.plist","Hash":"D5AF8017FF17826F921A9B71DA25EEAF4F030392A127F3836555FC5860DCB72B","HashAlgorithm":"SHA256","SizeInBytes":3212},{"ArtifactName":"pkg","Location":"https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/93171c00-f9f0-4e67-8949-0483270d6f53/MicrosoftEdge-121.0.2277.112.pkg","Hash":"5EB19B6D59BF27BE888BC633C0B1113845C5AB8F880D2119093FE258573CE421","HashAlgorithm":"SHA256","SizeInBytes":383828247}],"PublishedTime":"2024-02-08T19:49:00","ExpectedExpiryDate":"2025-02-08T19:49:00"}]},{"Product":"Beta","Releases":[{"ReleaseId":67472,"Platform":"iOS","Architecture":"arm64","CVEs":[],"ProductVersion":"122.0.2365.18","Artifacts":[],"PublishedTime":"2024-02-07T18:54:00","ExpectedExpiryDate":"2024-05-07T18:54:00"},{"ReleaseId":67474,"Platform":"Android","Architecture":"arm64","CVEs":[],"ProductVersion":"122.0.2365.18","Artifacts":[],"PublishedTime":"2024-02-07T19:21:00","ExpectedExpiryDate":"2024-05-07T19:21:00"},{"ReleaseId":67737,"Platform":"Windows","Architecture":"arm64","CVEs":[],"ProductVersion":"122.0.2365.30","Artifacts":[{"ArtifactName":"msi","Location":"https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/ebc011b5-8f23-46b6-a0d8-3cda48bbdfda/MicrosoftEdgeBetaEnterpriseARM64.msi","Hash":"97658B35922ED1F1084B2C9F762519276B64E2E00FC9FDA64B8BA394DAB7A9B3","HashAlgorithm":"SHA256","SizeInBytes":173514752}],"PublishedTime":"2024-02-12T19:24:00","ExpectedExpiryDate":"2024-05-12T19:24:00"},{"ReleaseId":67738,"Platform":"Linux","Architecture":"x64","CVEs":[],"ProductVersion":"122.0.2365.30","Artifacts":[{"ArtifactName":"rpm","Location":"https://packages.microsoft.com/yumrepos/edge/microsoft-edge-beta-122.0.2365.30-1.x86_64.rpm","Hash":"B9DBE8F64CD92782FB4E96AAA72D6B83447D096ABA92161AF26611C498506FE0","HashAlgorithm":"SHA256","SizeInBytes":168226560},{"ArtifactName":"deb","Location":"https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-beta/microsoft-edge-beta_122.0.2365.30-1_amd64.deb","Hash":"206B4E70209B572760C9B6BCC1ADD7383A390BBCAD59752BBF327767E52A367B","HashAlgorithm":"SHA256","SizeInBytes":165932382}],"PublishedTime":"2024-02-12T19:25:00","ExpectedExpiryDate":"2024-05-12T19:25:00"},{"ReleaseId":67746,"Platform":"MacOS","Architecture":"universal","CVEs":[],"ProductVersion":"122.0.2365.30","Artifacts":[{"ArtifactName":"plist","Location":"https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/75e11ebb-5702-45e6-a0bd-a5eacc3465d3/MicrosoftEdgeBeta-122.0.2365.30.plist","Hash":"75E59D2C6D68251F6E73C39492D2E40F63E24D6C3952D7906BE538328588B859","HashAlgorithm":"SHA256","SizeInBytes":3225},{"ArtifactName":"pkg","Location":"https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/da58d636-a739-46d0-849f-590a22c27fb5/MicrosoftEdgeBeta-122.0.2365.30.pkg","Hash":"EDE091A4F7EDAF1AB2193156DE1B2E399EAC237F68669D800A2D3E9F6BD20C22","HashAlgorithm":"SHA256","SizeInBytes":377725943}],"PublishedTime":"2024-02-12T19:33:00","ExpectedExpiryDate":"2024-05-12T19:33:00"},{"ReleaseId":67747,"Platform":"Windows","Architecture":"x64","CVEs":[],"ProductVersion":"122.0.2365.30","Artifacts":[{"ArtifactName":"msi","Location":"https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/4f145e13-8713-4646-84a9-e4dab5c79a65/MicrosoftEdgeBetaEnterpriseX64.msi","Hash":"AE0690ABBE55E6B698FC3363D55934A4F75C3E4BFADBCFA98651C211FE307C99","HashAlgorithm":"SHA256","SizeInBytes":177197056}],"PublishedTime":"2024-02-12T19:38:00","ExpectedExpiryDate":"2024-05-12T19:38:00"},{"ReleaseId":67748,"Platform":"Windows","Architecture":"x86","CVEs":[],"ProductVersion":"122.0.2365.30","Artifacts":[{"ArtifactName":"msi","Location":"https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/e74468e0-d223-4c4a-b99c-cb5e5b4b4847/MicrosoftEdgeBetaEnterpriseX86.msi","Hash":"C6647B38A6211A5B81D9C7B6ADA0F8F3F961455703492CE1694B882A2E29C9B2","HashAlgorithm":"SHA256","SizeInBytes":160706560}],"PublishedTime":"2024-02-12T19:39:00","ExpectedExpiryDate":"2024-05-12T19:39:00"}]},{"Product":"Dev","Releases":[{"ReleaseId":67384,"Platform":"Linux","Architecture":"x64","CVEs":[],"ProductVersion":"123.0.2380.1","Artifacts":[{"ArtifactName":"rpm","Location":"https://packages.microsoft.com/yumrepos/edge/microsoft-edge-dev-123.0.2380.1-1.x86_64.rpm","Hash":"6F14128390407E568DAFB8A9D4C8978D3A69C41795306B1E6CCA4A7966A7FD9C","HashAlgorithm":"SHA256","SizeInBytes":168682572},{"ArtifactName":"deb","Location":"https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-dev/microsoft-edge-dev_123.0.2380.1-1_amd64.deb","Hash":"4819475D44623E80B943BC22EBBB609EE5763D4C387DF9E21AAEA498E66D21FD","HashAlgorithm":"SHA256","SizeInBytes":166405746}],"PublishedTime":"2024-02-06T18:34:00","ExpectedExpiryDate":"2024-05-06T18:34:00"},{"ReleaseId":67385,"Platform":"Windows","Architecture":"arm64","CVEs":[],"ProductVersion":"123.0.2380.1","Artifacts":[{"ArtifactName":"msi","Location":"https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/80d72aeb-5625-47ed-b06b-0829eb65a8df/MicrosoftEdgeDevEnterpriseARM64.msi","Hash":"443CF58FB09699BFEB43E17B4A284565991FBE65974E2BC0A811DCB0E12668DE","HashAlgorithm":"SHA256","SizeInBytes":173256704}],"PublishedTime":"2024-02-06T18:35:00","ExpectedExpiryDate":"2024-05-06T18:35:00"},{"ReleaseId":67390,"Platform":"Android","Architecture":"arm64","CVEs":[],"ProductVersion":"123.0.2377.0","Artifacts":[],"PublishedTime":"2024-02-06T18:47:00","ExpectedExpiryDate":"2024-05-06T18:47:00"},{"ReleaseId":67394,"Platform":"Windows","Architecture":"x86","CVEs":[],"ProductVersion":"123.0.2380.1","Artifacts":[{"ArtifactName":"msi","Location":"https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/fc70fec9-3d59-4d89-a9b2-62b05367b54b/MicrosoftEdgeDevEnterpriseX86.msi","Hash":"B78BD999021D7EF3FA08A28189A9BF0229455BF45B9130B2DF6B6426348948FC","HashAlgorithm":"SHA256","SizeInBytes":160792576}],"PublishedTime":"2024-02-06T18:50:00","ExpectedExpiryDate":"2024-05-06T18:50:00"},{"ReleaseId":67395,"Platform":"Windows","Architecture":"x64","CVEs":[],"ProductVersion":"123.0.2380.1","Artifacts":[{"ArtifactName":"msi","Location":"https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/2b2c89e5-b4db-461d-a077-46e371f5a494/MicrosoftEdgeDevEnterpriseX64.msi","Hash":"D0EA0AB5292E1CE42152CD0C3F8BE2331A62CE4A7AAA8A2933B327A833531214","HashAlgorithm":"SHA256","SizeInBytes":177508352}],"PublishedTime":"2024-02-06T18:52:00","ExpectedExpiryDate":"2024-05-06T18:52:00"},{"ReleaseId":67397,"Platform":"iOS","Architecture":"arm64","CVEs":[],"ProductVersion":"123.0.2377.0","Artifacts":[],"PublishedTime":"2024-02-06T18:53:00","ExpectedExpiryDate":"2024-05-06T18:53:00"},{"ReleaseId":67417,"Platform":"MacOS","Architecture":"universal","CVEs":[],"ProductVersion":"123.0.2380.1","Artifacts":[{"ArtifactName":"plist","Location":"https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/6025451e-0214-427b-ac99-1a9521a2e469/MicrosoftEdgeDev-123.0.2380.1.plist","Hash":"A820F311B5282C160C2D38671924127625CB2036C94A81026714733FD77A92F4","HashAlgorithm":"SHA256","SizeInBytes":3221},{"ArtifactName":"pkg","Location":"https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/a921d251-7d72-4409-964f-d771e8bbc6b2/MicrosoftEdgeDev-123.0.2380.1.pkg","Hash":"D3BEBA0AF2D8FFF4F58059F5172567BCCE1994F5621E8F07A23D57BB90B2E836","HashAlgorithm":"SHA256","SizeInBytes":380878613}],"PublishedTime":"2024-02-06T21:01:00","ExpectedExpiryDate":"2024-05-06T21:01:00"}]},{"Product":"Canary","Releases":[{"ReleaseId":67530,"Platform":"Android","Architecture":"arm64","CVEs":[],"ProductVersion":"123.0.2391.0","Artifacts":[],"PublishedTime":"2024-02-08T11:14:00","ExpectedExpiryDate":"2024-05-08T11:14:00"},{"ReleaseId":67726,"Platform":"MacOS","Architecture":"universal","CVEs":[],"ProductVersion":"123.0.2400.0","Artifacts":[{"ArtifactName":"pkg","Location":"https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/84a377f5-db4d-4eb6-9983-d9d8404e27ef/MicrosoftEdgeCanary-123.0.2400.0.pkg","Hash":"9E0675A1661DF4496B571EE985B24E925145E0E21ADAE6D2CB5F6619E9EE68EA","HashAlgorithm":"SHA256","SizeInBytes":379051645},{"ArtifactName":"plist","Location":"https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/e0fe8d47-8565-4a2b-9faa-9308221eb208/MicrosoftEdgeCanary-123.0.2400.0.plist","Hash":"77981F8089DDC937F68D30A90A272714DE525339E752F15165D1A784599929BC","HashAlgorithm":"SHA256","SizeInBytes":3230}],"PublishedTime":"2024-02-12T13:36:00","ExpectedExpiryDate":"2024-05-12T13:36:00"},{"ReleaseId":67761,"Platform":"Windows","Architecture":"x86","CVEs":[],"ProductVersion":"123.0.2401.0","Artifacts":[],"PublishedTime":"2024-02-12T22:35:00","ExpectedExpiryDate":"2024-05-12T19:59:00"},{"ReleaseId":67762,"Platform":"Windows","Architecture":"x64","CVEs":[],"ProductVersion":"123.0.2401.0","Artifacts":[],"PublishedTime":"2024-02-12T22:36:00","ExpectedExpiryDate":"2024-05-12T20:00:00"},{"ReleaseId":67763,"Platform":"Windows","Architecture":"arm64","CVEs":[],"ProductVersion":"123.0.2401.0","Artifacts":[],"PublishedTime":"2024-02-12T22:17:00","ExpectedExpiryDate":"2024-05-12T20:01:00"}]},{"Product":"EdgeUpdate","Releases":[{"ReleaseId":67265,"Platform":"Windows","Architecture":"x86","CVEs":[],"ProductVersion":"1.3.183.29","Artifacts":[{"ArtifactName":"exe","Location":"https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/122fc350-ec41-4cd2-b581-63a2f59ed196/MicrosoftEdgeUpdateSetup_X86_1.3.183.29.exe","Hash":"611730CE9E8CB3B7FD31A9E064308175EAE4C173B46A84529EE43B4F22C21455","HashAlgorithm":"SHA256","SizeInBytes":1616456}],"PublishedTime":"2024-02-05T18:27:00","ExpectedExpiryDate":"2025-02-05T18:27:00"}]}]
42 changes: 41 additions & 1 deletion tests/unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { vi, test, expect } from 'vitest'
import * as pkgExports from '../src/index.js'
import { fetchVersion } from '../src/install.js'
import { getNameByArchitecture, parseParams } from '../src/utils.js'
import { EDGE_PRODUCTS_API } from '../src/constants.js'

vi.mock('node:os', () => ({
default: {
Expand All @@ -12,11 +13,50 @@ vi.mock('node:os', () => ({
}
}))

vi.mock('node-fetch', async (orig) => {
const origFetch: any = await orig()
const apiResponse = await import('./__fixtures__/api.json', { assert: { type: 'json' } })
return {
default: vi.fn(async (url) => {
if (url === EDGE_PRODUCTS_API) {
return {
json: vi.fn().mockResolvedValue(apiResponse.default)
}
} else if (!url.includes('LATEST_RELEASE')) {
return {
text: vi.fn().mockResolvedValue('��123.456.789.0')
}
}

return origFetch.default(url)
})
}
})

test('fetchVersion', async () => {
expect(await fetchVersion('123.456.789.0')).toBe('123.456.789.0')
expect(await fetchVersion('beta')).toEqual(expect.any(String))
expect(await fetchVersion('beta')).toBe('122.0.2365.30')
expect(await fetchVersion('some114version')).toBe('114.0.1823.82')
await expect(fetchVersion('latest-win')).rejects.toThrow()
vi.mocked(os.arch).mockReturnValue('arm')
vi.mocked(os.platform).mockReturnValue('linux')
expect(await fetchVersion('stable')).toBe('121.0.2277.113')
vi.mocked(os.arch).mockReturnValue('arm64')
vi.mocked(os.platform).mockReturnValue('linux')
expect(await fetchVersion('stable')).toBe('121.0.2277.113')
vi.mocked(os.arch).mockReturnValue('arm')
vi.mocked(os.platform).mockReturnValue('win32')
expect(await fetchVersion('stable')).toBe('123.456.789.0')
vi.mocked(os.arch).mockReturnValue('arm64')
vi.mocked(os.platform).mockReturnValue('win32')
expect(await fetchVersion('stable')).toBe('121.0.2277.112')
vi.mocked(os.arch).mockReturnValue('x64')
vi.mocked(os.platform).mockReturnValue('darwin')
expect(await fetchVersion('stable')).toBe('121.0.2277.112')
vi.mocked(os.arch).mockReturnValue('arm64')
vi.mocked(os.platform).mockReturnValue('darwin')
expect(await fetchVersion('stable')).toBe('121.0.2277.112')

})

test('getNameByArchitecture', () => {
Expand Down

0 comments on commit f735947

Please sign in to comment.