@@ -3,42 +3,94 @@ import { createTempDir } from 'broccoli-test-helper';
33import nock from 'nock' ;
44
55describe ( 'buildDownloadUrl' , ( ) => {
6- test ( 'darwin' , async function ( ) {
7- expect ( await buildDownloadUrl ( 'darwin' , '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- } ) ;
6+ describe ( '[email protected] ' , function ( ) { 7+ test ( 'darwin - x64' , async function ( ) {
8+ expect ( await buildDownloadUrl ( 'darwin' , 'x64' , '1.0.0' ) ) . toMatchInlineSnapshot (
9+ `"https://github.com/volta-cli/volta/releases/download/v1.0.0/volta-1.0.0-macos.tar.gz"`
10+ ) ;
11+ } ) ;
1112
12- test ( 'linux' , async function ( ) {
13- expect (
14- await buildDownloadUrl ( 'linux' , '0.6.4' , '' , 'OpenSSL 1.0.1e-fips 11 Feb 2013' )
15- ) . toMatchInlineSnapshot (
16- `"https://github.com/volta-cli/volta/releases/download/v0.6.4/volta-0.6.4-linux-openssl-1.0.tar.gz"`
17- ) ;
13+ test ( 'darwin - arm64' , async function ( ) {
14+ expect ( await buildDownloadUrl ( 'darwin' , 'arm64' , '1.0.0' ) ) . toMatchInlineSnapshot (
15+ `"https://github.com/volta-cli/volta/releases/download/v1.0.0/volta-1.0.0-macos.tar.gz"`
16+ ) ;
17+ } ) ;
1818
19- expect (
20- await buildDownloadUrl ( 'linux' , '0.6.4' , '' , 'OpenSSL 1.1.1e-fips 11 Sep 2018' )
21- ) . toMatchInlineSnapshot (
22- `"https://github.com/volta-cli/volta/releases/download/v0.6.4/volta-0.6.4-linux-openssl-1.1.tar.gz"`
23- ) ;
24- } ) ;
19+ test ( 'linux' , async function ( ) {
20+ expect (
21+ await buildDownloadUrl ( 'linux' , 'x64' , '1.0.0' , '' , 'OpenSSL 1.0.1e-fips 11 Feb 2013' )
22+ ) . toMatchInlineSnapshot (
23+ `"https://github.com/volta-cli/volta/releases/download/v1.0.0/volta-1.0.0-linux-openssl-1.0.tar.gz"`
24+ ) ;
25+
26+ expect (
27+ await buildDownloadUrl ( 'linux' , 'x64' , '1.0.0' , '' , 'OpenSSL 1.1.1e-fips 11 Sep 2018' )
28+ ) . toMatchInlineSnapshot (
29+ `"https://github.com/volta-cli/volta/releases/download/v1.0.0/volta-1.0.0-linux-openssl-1.1.tar.gz"`
30+ ) ;
31+ } ) ;
2532
26- test ( 'linux with variant input' , async function ( ) {
27- expect ( await buildDownloadUrl ( 'linux' , '0.6.4' , 'linux-openssl-rhel' ) ) . toMatchInlineSnapshot (
28- `"https://github.com/volta-cli/volta/releases/download/v0.6.4/volta-0.6.4-linux-openssl-rhel.tar.gz"`
29- ) ;
30- } ) ;
33+ test ( 'linux with variant input' , async function ( ) {
34+ expect (
35+ await buildDownloadUrl ( 'linux' , 'x64' , '1.0.0' , 'linux-openssl-rhel' )
36+ ) . toMatchInlineSnapshot (
37+ `"https://github.com/volta-cli/volta/releases/download/v1.0.0/volta-1.0.0-linux-openssl-rhel.tar.gz"`
38+ ) ;
39+ } ) ;
3140
32- test ( 'win32' , async function ( ) {
33- expect ( await buildDownloadUrl ( 'win32' , '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- ) ;
41+ test ( 'win32' , async function ( ) {
42+ expect ( await buildDownloadUrl ( 'win32' , 'x86-64' , '1.0.0' ) ) . toMatchInlineSnapshot (
43+ `"https://github.com/volta-cli/volta/releases/download/v1.0.0/volta-1.0.0-windows-x86_64.msi"`
44+ ) ;
45+ } ) ;
46+
47+ test ( 'aix' , async function ( ) {
48+ expect (
49+ async ( ) =>
50+ await buildDownloadUrl ( 'aix' , 'hmm, wat?? (I dont know a valid arch for aix)' , '1.0.0' )
51+ ) . rejects . toThrowErrorMatchingInlineSnapshot ( `"your platform aix is not yet supported"` ) ;
52+ } ) ;
3653 } ) ;
3754
38- test ( 'aix' , async function ( ) {
39- expect (
40- async ( ) => await buildDownloadUrl ( 'aix' , '0.6.4' )
41- ) . rejects . toThrowErrorMatchingInlineSnapshot ( `"your platform aix is not yet supported"` ) ;
55+ describe ( '[email protected] ' , function ( ) { 56+ test ( 'darwin - x64' , async function ( ) {
57+ expect ( await buildDownloadUrl ( 'darwin' , 'x64' , '1.1.0' ) ) . toMatchInlineSnapshot (
58+ `"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-macos.tar.gz"`
59+ ) ;
60+ } ) ;
61+
62+ test ( 'darwin - arm64' , async function ( ) {
63+ expect ( await buildDownloadUrl ( 'darwin' , 'arm64' , '1.1.0' ) ) . toMatchInlineSnapshot (
64+ `"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-macos-aarch64.tar.gz"`
65+ ) ;
66+ } ) ;
67+
68+ test ( 'linux' , async function ( ) {
69+ expect ( await buildDownloadUrl ( 'linux' , 'x64' , '1.1.0' ) ) . toMatchInlineSnapshot (
70+ `"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-linux.tar.gz"`
71+ ) ;
72+ } ) ;
73+
74+ test ( 'linux with variant input' , async function ( ) {
75+ expect (
76+ await buildDownloadUrl ( 'linux' , 'x64' , '1.1.0' , 'linux-openssl-rhel' )
77+ ) . toMatchInlineSnapshot (
78+ `"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-linux-openssl-rhel.tar.gz"`
79+ ) ;
80+ } ) ;
81+
82+ test ( 'win32' , async function ( ) {
83+ expect ( await buildDownloadUrl ( 'win32' , 'x86-64' , '1.1.0' ) ) . toMatchInlineSnapshot (
84+ `"https://github.com/volta-cli/volta/releases/download/v1.1.0/volta-1.1.0-windows-x86_64.msi"`
85+ ) ;
86+ } ) ;
87+
88+ test ( 'aix' , async function ( ) {
89+ expect (
90+ async ( ) =>
91+ await buildDownloadUrl ( 'aix' , 'hmm, wat?? (I dont know a valid arch for aix)' , '1.1.0' )
92+ ) . rejects . toThrowErrorMatchingInlineSnapshot ( `"your platform aix is not yet supported"` ) ;
93+ } ) ;
4294 } ) ;
4395} ) ;
4496
0 commit comments