@@ -2,28 +2,78 @@ import { buildLayout, buildDownloadUrl } from './installer';
22import { createTempDir } from 'broccoli-test-helper' ;
33
44describe ( 'buildDownloadUrl' , ( ) => {
5- test ( 'darwin' , function ( ) {
6- expect ( buildDownloadUrl ( 'darwin' , '0.6.4' ) ) . toMatchInlineSnapshot (
7- `"https://github.com/volta-cli/volta/releases/download/v0.6.4/volta-0.6.4-macos.tar.gz"`
8- ) ;
9- } ) ;
5+ describe ( 'volta < 1.1.0' , function ( ) {
6+ test ( 'darwin - x64' , async function ( ) {
7+ expect ( await buildDownloadUrl ( 'darwin' , 'x64' , '0.6.4' ) ) . toMatchInlineSnapshot (
8+ `"https://github.com/volta-cli/volta/releases/download/v0.6.4/volta-0.6.4-macos.tar.gz"`
9+ ) ;
10+ } ) ;
1011
11- test ( 'linux' , function ( ) {
12- expect ( buildDownloadUrl ( 'linux' , '0.6.4' ) ) . toMatchInlineSnapshot (
13- `"https://github.com/volta-cli/volta/releases/download/v0.6.4/volta-0.6.4-linux-openssl-1.1.tar.gz"`
14- ) ;
15- } ) ;
12+ test ( 'darwin - arm64' , async function ( ) {
13+ expect ( await buildDownloadUrl ( 'darwin' , 'arm64' , '0.6.4' ) ) . toMatchInlineSnapshot (
14+ `"https://github.com/volta-cli/volta/releases/download/v0.6.4/volta-0.6.4-macos.tar.gz"`
15+ ) ;
16+ } ) ;
17+
18+ test ( 'linux' , async function ( ) {
19+ expect ( await buildDownloadUrl ( 'linux' , 'x64' , '0.6.4' ) ) . toMatchInlineSnapshot (
20+ `"https://github.com/volta-cli/volta/releases/download/v0.6.4/volta-0.6.4-linux-openssl-1.1.tar.gz"`
21+ ) ;
22+ } ) ;
23+
24+ test ( 'win32' , async function ( ) {
25+ expect ( await buildDownloadUrl ( 'win32' , 'x86-64' , '0.7.2' ) ) . toMatchInlineSnapshot (
26+ `"https://github.com/volta-cli/volta/releases/download/v0.7.2/volta-0.7.2-windows-x86_64.msi"`
27+ ) ;
28+ } ) ;
1629
17- test ( 'win32' , function ( ) {
18- expect ( buildDownloadUrl ( 'win32' , '0.7.2' ) ) . toMatchInlineSnapshot (
19- `"https://github.com/volta-cli/volta/releases/download/v0.7.2/volta-0.7.2-windows-x86_64.msi"`
20- ) ;
30+ test ( 'aix' , async function ( ) {
31+ expect (
32+ async ( ) =>
33+ await buildDownloadUrl ( 'aix' , 'hmm, wat?? (I dont know a valid arch for aix)' , '0.6.4' )
34+ ) . rejects . toThrowErrorMatchingInlineSnapshot ( `"your platform aix is not yet supported"` ) ;
35+ } ) ;
2136 } ) ;
2237
23- test ( 'aix' , function ( ) {
24- expect ( ( ) => buildDownloadUrl ( 'aix' , '0.6.4' ) ) . toThrowErrorMatchingInlineSnapshot (
25- `"your platform aix is not yet supported"`
26- ) ;
38+ describe ( '[email protected] ' , function ( ) { 39+ test ( 'darwin - x64' , async function ( ) {
40+ expect ( await buildDownloadUrl ( 'darwin' , 'x64' , '1.1.0' ) ) . toMatchInlineSnapshot (
41+ `"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-macos.tar.gz"`
42+ ) ;
43+ } ) ;
44+
45+ test ( 'darwin - arm64' , async function ( ) {
46+ expect ( await buildDownloadUrl ( 'darwin' , 'arm64' , '1.1.0' ) ) . toMatchInlineSnapshot (
47+ `"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-macos-aarch64.tar.gz"`
48+ ) ;
49+ } ) ;
50+
51+ test ( 'linux' , async function ( ) {
52+ expect ( await buildDownloadUrl ( 'linux' , 'x64' , '1.1.0' ) ) . toMatchInlineSnapshot (
53+ `"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-linux.tar.gz"`
54+ ) ;
55+
56+ expect ( await buildDownloadUrl ( 'linux' , 'x64' , '1.1.0' ) ) . toMatchInlineSnapshot (
57+ `"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-linux.tar.gz"`
58+ ) ;
59+
60+ expect ( await buildDownloadUrl ( 'linux' , 'x64' , '1.1.0' ) ) . toMatchInlineSnapshot (
61+ `"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-linux.tar.gz"`
62+ ) ;
63+ } ) ;
64+
65+ test ( 'win32' , async function ( ) {
66+ expect ( await buildDownloadUrl ( 'win32' , 'x86-64' , '1.1.0' ) ) . toMatchInlineSnapshot (
67+ `"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-windows-x86_64.msi"`
68+ ) ;
69+ } ) ;
70+
71+ test ( 'aix' , async function ( ) {
72+ expect (
73+ async ( ) =>
74+ await buildDownloadUrl ( 'aix' , 'hmm, wat?? (I dont know a valid arch for aix)' , '1.1.0' )
75+ ) . rejects . toThrowErrorMatchingInlineSnapshot ( `"your platform aix is not yet supported"` ) ;
76+ } ) ;
2777 } ) ;
2878} ) ;
2979
@@ -40,33 +90,33 @@ describe('buildLayout', () => {
4090 await buildLayout ( tmpdir . path ( ) ) ;
4191
4292 expect ( tmpdir . read ( ) ) . toMatchInlineSnapshot ( `
43- Object {
44- "bin": Object {
45- "node": "shim-file-here",
46- "npm": "shim-file-here",
47- "npx": "shim-file-here",
48- "shim": "shim-file-here",
49- "yarn": "shim-file-here",
50- },
51- "cache": Object {
52- "node": Object {},
53- },
54- "log": Object {},
55- "tmp": Object {},
56- "tools": Object {
57- "image": Object {
58- "node": Object {},
59- "packages": Object {},
60- "yarn": Object {},
61- },
62- "inventory": Object {
63- "node": Object {},
64- "packages": Object {},
65- "yarn": Object {},
66- },
67- "user": Object {},
68- },
69- }
70- ` ) ;
93+ Object {
94+ "bin": Object {
95+ "node": "shim-file-here",
96+ "npm": "shim-file-here",
97+ "npx": "shim-file-here",
98+ "shim": "shim-file-here",
99+ "yarn": "shim-file-here",
100+ },
101+ "cache": Object {
102+ "node": Object {},
103+ },
104+ "log": Object {},
105+ "tmp": Object {},
106+ "tools": Object {
107+ "image": Object {
108+ "node": Object {},
109+ "packages": Object {},
110+ "yarn": Object {},
111+ },
112+ "inventory": Object {
113+ "node": Object {},
114+ "packages": Object {},
115+ "yarn": Object {},
116+ },
117+ "user": Object {},
118+ },
119+ }
120+ `) ;
71121 } ) ;
72122} ) ;
0 commit comments