generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #119 from volta-cli/backport-1.1.0-support-for-v2.x
- Loading branch information
Showing
3 changed files
with
145 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,36 +2,90 @@ import { buildLayout, buildDownloadUrl } from './installer'; | |
import { createTempDir } from 'broccoli-test-helper'; | ||
|
||
describe('buildDownloadUrl', () => { | ||
test('darwin', async function () { | ||
expect(await buildDownloadUrl('darwin', '0.6.4')).toMatchInlineSnapshot( | ||
`"https://github.com/volta-cli/volta/releases/download/v0.6.4/volta-0.6.4-macos.tar.gz"` | ||
); | ||
}); | ||
describe('volta < 1.1.0', function () { | ||
test('darwin - x64', async function () { | ||
expect(await buildDownloadUrl('darwin', 'x64', '0.6.4')).toMatchInlineSnapshot( | ||
`"https://github.com/volta-cli/volta/releases/download/v0.6.4/volta-0.6.4-macos.tar.gz"` | ||
); | ||
}); | ||
|
||
test('linux', async function () { | ||
expect( | ||
await buildDownloadUrl('linux', '0.6.4', 'OpenSSL 1.0.1e-fips 11 Feb 2013') | ||
).toMatchInlineSnapshot( | ||
`"https://github.com/volta-cli/volta/releases/download/v0.6.4/volta-0.6.4-linux-openssl-1.0.tar.gz"` | ||
); | ||
|
||
expect( | ||
await buildDownloadUrl('linux', '0.6.4', 'OpenSSL 1.1.1e-fips 11 Sep 2018') | ||
).toMatchInlineSnapshot( | ||
`"https://github.com/volta-cli/volta/releases/download/v0.6.4/volta-0.6.4-linux-openssl-1.1.tar.gz"` | ||
); | ||
}); | ||
test('darwin - arm64', async function () { | ||
expect(await buildDownloadUrl('darwin', 'arm64', '0.6.4')).toMatchInlineSnapshot( | ||
`"https://github.com/volta-cli/volta/releases/download/v0.6.4/volta-0.6.4-macos.tar.gz"` | ||
); | ||
}); | ||
|
||
test('linux', async function () { | ||
expect( | ||
await buildDownloadUrl('linux', 'x64', '0.6.4', 'OpenSSL 1.0.1e-fips 11 Feb 2013') | ||
).toMatchInlineSnapshot( | ||
`"https://github.com/volta-cli/volta/releases/download/v0.6.4/volta-0.6.4-linux-openssl-1.0.tar.gz"` | ||
); | ||
|
||
test('win32', async function () { | ||
expect(await buildDownloadUrl('win32', '0.7.2')).toMatchInlineSnapshot( | ||
`"https://github.com/volta-cli/volta/releases/download/v0.7.2/volta-0.7.2-windows-x86_64.msi"` | ||
); | ||
expect( | ||
await buildDownloadUrl('linux', 'x64', '0.6.4', 'OpenSSL 1.1.1e-fips 11 Sep 2018') | ||
).toMatchInlineSnapshot( | ||
`"https://github.com/volta-cli/volta/releases/download/v0.6.4/volta-0.6.4-linux-openssl-1.1.tar.gz"` | ||
); | ||
}); | ||
|
||
test('win32', async function () { | ||
expect(await buildDownloadUrl('win32', 'x86-64', '0.7.2')).toMatchInlineSnapshot( | ||
`"https://github.com/volta-cli/volta/releases/download/v0.7.2/volta-0.7.2-windows-x86_64.msi"` | ||
); | ||
}); | ||
|
||
test('aix', async function () { | ||
expect( | ||
async () => | ||
await buildDownloadUrl('aix', 'hmm, wat?? (I dont know a valid arch for aix)', '0.6.4') | ||
).rejects.toThrowErrorMatchingInlineSnapshot(`"your platform aix is not yet supported"`); | ||
}); | ||
}); | ||
|
||
test('aix', async function () { | ||
expect( | ||
async () => await buildDownloadUrl('aix', '0.6.4') | ||
).rejects.toThrowErrorMatchingInlineSnapshot(`"your platform aix is not yet supported"`); | ||
describe('[email protected]', function () { | ||
test('darwin - x64', async function () { | ||
expect(await buildDownloadUrl('darwin', 'x64', '1.1.0')).toMatchInlineSnapshot( | ||
`"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-macos.tar.gz"` | ||
); | ||
}); | ||
|
||
test('darwin - arm64', async function () { | ||
expect(await buildDownloadUrl('darwin', 'arm64', '1.1.0')).toMatchInlineSnapshot( | ||
`"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-macos-aarch64.tar.gz"` | ||
); | ||
}); | ||
|
||
test('linux', async function () { | ||
expect( | ||
await buildDownloadUrl('linux', 'x64', '1.1.0', 'OpenSSL 1.0.1e-fips 11 Feb 2013') | ||
).toMatchInlineSnapshot( | ||
`"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-linux.tar.gz"` | ||
); | ||
|
||
expect( | ||
await buildDownloadUrl('linux', 'x64', '1.1.0', 'OpenSSL 1.1.1e-fips 11 Sep 2018') | ||
).toMatchInlineSnapshot( | ||
`"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-linux.tar.gz"` | ||
); | ||
|
||
expect(await buildDownloadUrl('linux', 'x64', '1.1.0')).toMatchInlineSnapshot( | ||
`"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-linux.tar.gz"` | ||
); | ||
}); | ||
|
||
test('win32', async function () { | ||
expect(await buildDownloadUrl('win32', 'x86-64', '1.1.0')).toMatchInlineSnapshot( | ||
`"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-windows-x86_64.msi"` | ||
); | ||
}); | ||
|
||
test('aix', async function () { | ||
expect( | ||
async () => | ||
await buildDownloadUrl('aix', 'hmm, wat?? (I dont know a valid arch for aix)', '1.1.0') | ||
).rejects.toThrowErrorMatchingInlineSnapshot(`"your platform aix is not yet supported"`); | ||
}); | ||
}); | ||
}); | ||
|
||
|
@@ -48,33 +102,33 @@ describe('buildLayout', () => { | |
await buildLayout(tmpdir.path()); | ||
|
||
expect(tmpdir.read()).toMatchInlineSnapshot(` | ||
Object { | ||
"bin": Object { | ||
"node": "shim-file-here", | ||
"npm": "shim-file-here", | ||
"npx": "shim-file-here", | ||
"shim": "shim-file-here", | ||
"yarn": "shim-file-here", | ||
}, | ||
"cache": Object { | ||
"node": Object {}, | ||
}, | ||
"log": Object {}, | ||
"tmp": Object {}, | ||
"tools": Object { | ||
"image": Object { | ||
"node": Object {}, | ||
"packages": Object {}, | ||
"yarn": Object {}, | ||
}, | ||
"inventory": Object { | ||
"node": Object {}, | ||
"packages": Object {}, | ||
"yarn": Object {}, | ||
}, | ||
"user": Object {}, | ||
}, | ||
} | ||
`); | ||
Object { | ||
"bin": Object { | ||
"node": "shim-file-here", | ||
"npm": "shim-file-here", | ||
"npx": "shim-file-here", | ||
"shim": "shim-file-here", | ||
"yarn": "shim-file-here", | ||
}, | ||
"cache": Object { | ||
"node": Object {}, | ||
}, | ||
"log": Object {}, | ||
"tmp": Object {}, | ||
"tools": Object { | ||
"image": Object { | ||
"node": Object {}, | ||
"packages": Object {}, | ||
"yarn": Object {}, | ||
}, | ||
"inventory": Object { | ||
"node": Object {}, | ||
"packages": Object {}, | ||
"yarn": Object {}, | ||
}, | ||
"user": Object {}, | ||
}, | ||
} | ||
`); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters