@@ -2,36 +2,90 @@ import { buildLayout, buildDownloadUrl } from './installer';
22import { createTempDir } from 'broccoli-test-helper' ;
33
44describe ( 'buildDownloadUrl' , ( ) => {
5- test ( 'darwin' , async function ( ) {
6- expect ( await 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' , async function ( ) {
12- expect (
13- await buildDownloadUrl ( 'linux' , '0.6.4' , 'OpenSSL 1.0.1e-fips 11 Feb 2013' )
14- ) . toMatchInlineSnapshot (
15- `"https://github.com/volta-cli/volta/releases/download/v0.6.4/volta-0.6.4-linux-openssl-1.0.tar.gz"`
16- ) ;
17-
18- expect (
19- await buildDownloadUrl ( 'linux' , '0.6.4' , 'OpenSSL 1.1.1e-fips 11 Sep 2018' )
20- ) . toMatchInlineSnapshot (
21- `"https://github.com/volta-cli/volta/releases/download/v0.6.4/volta-0.6.4-linux-openssl-1.1.tar.gz"`
22- ) ;
23- } ) ;
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 (
20+ await buildDownloadUrl ( 'linux' , 'x64' , '0.6.4' , 'OpenSSL 1.0.1e-fips 11 Feb 2013' )
21+ ) . toMatchInlineSnapshot (
22+ `"https://github.com/volta-cli/volta/releases/download/v0.6.4/volta-0.6.4-linux-openssl-1.0.tar.gz"`
23+ ) ;
2424
25- test ( 'win32' , async function ( ) {
26- expect ( await buildDownloadUrl ( 'win32' , '0.7.2' ) ) . toMatchInlineSnapshot (
27- `"https://github.com/volta-cli/volta/releases/download/v0.7.2/volta-0.7.2-windows-x86_64.msi"`
28- ) ;
25+ expect (
26+ await buildDownloadUrl ( 'linux' , 'x64' , '0.6.4' , 'OpenSSL 1.1.1e-fips 11 Sep 2018' )
27+ ) . toMatchInlineSnapshot (
28+ `"https://github.com/volta-cli/volta/releases/download/v0.6.4/volta-0.6.4-linux-openssl-1.1.tar.gz"`
29+ ) ;
30+ } ) ;
31+
32+ test ( 'win32' , async function ( ) {
33+ expect ( await buildDownloadUrl ( 'win32' , 'x86-64' , '0.7.2' ) ) . toMatchInlineSnapshot (
34+ `"https://github.com/volta-cli/volta/releases/download/v0.7.2/volta-0.7.2-windows-x86_64.msi"`
35+ ) ;
36+ } ) ;
37+
38+ test ( 'aix' , async function ( ) {
39+ expect (
40+ async ( ) =>
41+ await buildDownloadUrl ( 'aix' , 'hmm, wat?? (I dont know a valid arch for aix)' , '0.6.4' )
42+ ) . rejects . toThrowErrorMatchingInlineSnapshot ( `"your platform aix is not yet supported"` ) ;
43+ } ) ;
2944 } ) ;
3045
31- test ( 'aix' , async function ( ) {
32- expect (
33- async ( ) => await buildDownloadUrl ( 'aix' , '0.6.4' )
34- ) . rejects . toThrowErrorMatchingInlineSnapshot ( `"your platform aix is not yet supported"` ) ;
46+ describe ( '[email protected] ' , function ( ) { 47+ test ( 'darwin - x64' , async function ( ) {
48+ expect ( await buildDownloadUrl ( 'darwin' , 'x64' , '1.1.0' ) ) . toMatchInlineSnapshot (
49+ `"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-macos.tar.gz"`
50+ ) ;
51+ } ) ;
52+
53+ test ( 'darwin - arm64' , async function ( ) {
54+ expect ( await buildDownloadUrl ( 'darwin' , 'arm64' , '1.1.0' ) ) . toMatchInlineSnapshot (
55+ `"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-macos-aarch64.tar.gz"`
56+ ) ;
57+ } ) ;
58+
59+ test ( 'linux' , async function ( ) {
60+ expect (
61+ await buildDownloadUrl ( 'linux' , 'x64' , '1.1.0' , 'OpenSSL 1.0.1e-fips 11 Feb 2013' )
62+ ) . toMatchInlineSnapshot (
63+ `"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-linux.tar.gz"`
64+ ) ;
65+
66+ expect (
67+ await buildDownloadUrl ( 'linux' , 'x64' , '1.1.0' , 'OpenSSL 1.1.1e-fips 11 Sep 2018' )
68+ ) . toMatchInlineSnapshot (
69+ `"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-linux.tar.gz"`
70+ ) ;
71+
72+ expect ( await buildDownloadUrl ( 'linux' , 'x64' , '1.1.0' ) ) . toMatchInlineSnapshot (
73+ `"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-linux.tar.gz"`
74+ ) ;
75+ } ) ;
76+
77+ test ( 'win32' , async function ( ) {
78+ expect ( await buildDownloadUrl ( 'win32' , 'x86-64' , '1.1.0' ) ) . toMatchInlineSnapshot (
79+ `"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-windows-x86_64.msi"`
80+ ) ;
81+ } ) ;
82+
83+ test ( 'aix' , async function ( ) {
84+ expect (
85+ async ( ) =>
86+ await buildDownloadUrl ( 'aix' , 'hmm, wat?? (I dont know a valid arch for aix)' , '1.1.0' )
87+ ) . rejects . toThrowErrorMatchingInlineSnapshot ( `"your platform aix is not yet supported"` ) ;
88+ } ) ;
3589 } ) ;
3690} ) ;
3791
@@ -48,33 +102,33 @@ describe('buildLayout', () => {
48102 await buildLayout ( tmpdir . path ( ) ) ;
49103
50104 expect ( tmpdir . read ( ) ) . toMatchInlineSnapshot ( `
51- Object {
52- "bin": Object {
53- "node": "shim-file-here",
54- "npm": "shim-file-here",
55- "npx": "shim-file-here",
56- "shim": "shim-file-here",
57- "yarn": "shim-file-here",
58- },
59- "cache": Object {
60- "node": Object {},
61- },
62- "log": Object {},
63- "tmp": Object {},
64- "tools": Object {
65- "image": Object {
66- "node": Object {},
67- "packages": Object {},
68- "yarn": Object {},
69- },
70- "inventory": Object {
71- "node": Object {},
72- "packages": Object {},
73- "yarn": Object {},
74- },
75- "user": Object {},
76- },
77- }
78- ` ) ;
105+ Object {
106+ "bin": Object {
107+ "node": "shim-file-here",
108+ "npm": "shim-file-here",
109+ "npx": "shim-file-here",
110+ "shim": "shim-file-here",
111+ "yarn": "shim-file-here",
112+ },
113+ "cache": Object {
114+ "node": Object {},
115+ },
116+ "log": Object {},
117+ "tmp": Object {},
118+ "tools": Object {
119+ "image": Object {
120+ "node": Object {},
121+ "packages": Object {},
122+ "yarn": Object {},
123+ },
124+ "inventory": Object {
125+ "node": Object {},
126+ "packages": Object {},
127+ "yarn": Object {},
128+ },
129+ "user": Object {},
130+ },
131+ }
132+ `) ;
79133 } ) ;
80134} ) ;
0 commit comments