@@ -4,29 +4,62 @@ import { describe, it, expect } from 'vitest';
44
55describe ( 'checkPlatform' , ( ) => {
66 it ( 'should return "darwin" for MacOS .app tar.gz files' , ( ) => {
7- expect ( checkPlatform ( LEGACY_AVAILABLE_PLATFORMS . MacOS , 'myApp.app.tar.gz' ) ) . toBe ( 'darwin' ) ;
8- expect ( checkPlatform ( LEGACY_AVAILABLE_PLATFORMS . MacOS , 'myApp.darwin.tar.gz' ) ) . toBe ( 'darwin' ) ;
9- expect ( checkPlatform ( LEGACY_AVAILABLE_PLATFORMS . MacOS , 'myApp.osx.tar.gz' ) ) . toBe ( 'darwin' ) ;
7+ expect (
8+ checkPlatform ( LEGACY_AVAILABLE_PLATFORMS . MacOS , 'myApp.app.tar.gz' )
9+ ) . toBe ( 'darwin' ) ;
10+ expect (
11+ checkPlatform (
12+ LEGACY_AVAILABLE_PLATFORMS . MacOS ,
13+ 'myApp.darwin.tar.gz'
14+ )
15+ ) . toBe ( 'darwin' ) ;
16+ expect (
17+ checkPlatform ( LEGACY_AVAILABLE_PLATFORMS . MacOS , 'myApp.osx.tar.gz' )
18+ ) . toBe ( 'darwin' ) ;
1019 } ) ;
1120
1221 it ( 'should return "win64" for Windows 64 bits zip files' , ( ) => {
13- expect ( checkPlatform ( LEGACY_AVAILABLE_PLATFORMS . Win64 , 'myApp.x64.zip' ) ) . toBe ( 'win64' ) ;
14- expect ( checkPlatform ( LEGACY_AVAILABLE_PLATFORMS . Win64 , 'myApp.win64.zip' ) ) . toBe ( 'win64' ) ;
22+ expect (
23+ checkPlatform ( LEGACY_AVAILABLE_PLATFORMS . Win64 , 'myApp.x64.zip' )
24+ ) . toBe ( 'win64' ) ;
25+ expect (
26+ checkPlatform ( LEGACY_AVAILABLE_PLATFORMS . Win64 , 'myApp.win64.zip' )
27+ ) . toBe ( 'win64' ) ;
1528 } ) ;
1629
1730 it ( 'should return "win32" for Windows 32 bits zip files' , ( ) => {
18- expect ( checkPlatform ( LEGACY_AVAILABLE_PLATFORMS . Win32 , 'myApp.x32.zip' ) ) . toBe ( 'win32' ) ;
19- expect ( checkPlatform ( LEGACY_AVAILABLE_PLATFORMS . Win32 , 'myApp.win32.zip' ) ) . toBe ( 'win32' ) ;
31+ expect (
32+ checkPlatform ( LEGACY_AVAILABLE_PLATFORMS . Win32 , 'myApp.x32.zip' )
33+ ) . toBe ( 'win32' ) ;
34+ expect (
35+ checkPlatform ( LEGACY_AVAILABLE_PLATFORMS . Win32 , 'myApp.win32.zip' )
36+ ) . toBe ( 'win32' ) ;
2037 } ) ;
2138
2239 it ( 'should return "linux" for Linux AppImage gz files' , ( ) => {
23- expect ( checkPlatform ( LEGACY_AVAILABLE_PLATFORMS . Linux , 'myApp.AppImage.tar.gz' ) ) . toBe ( 'linux' ) ;
40+ expect (
41+ checkPlatform (
42+ LEGACY_AVAILABLE_PLATFORMS . Linux ,
43+ 'myApp.AppImage.tar.gz'
44+ )
45+ ) . toBe ( 'linux' ) ;
2446 } ) ;
2547
2648 it ( 'should return undefined for non-matching files' , ( ) => {
27- expect ( checkPlatform ( LEGACY_AVAILABLE_PLATFORMS . MacOS , 'myApp.exe' ) ) . toBeUndefined ( ) ;
28- expect ( checkPlatform ( LEGACY_AVAILABLE_PLATFORMS . Win64 , 'myApp.app.tar.gz' ) ) . toBeUndefined ( ) ;
29- expect ( checkPlatform ( LEGACY_AVAILABLE_PLATFORMS . Win32 , 'myApp.AppImage.tar.gz' ) ) . toBeUndefined ( ) ;
30- expect ( checkPlatform ( LEGACY_AVAILABLE_PLATFORMS . Linux , 'myApp.x64.zip' ) ) . toBeUndefined ( ) ;
49+ expect (
50+ checkPlatform ( LEGACY_AVAILABLE_PLATFORMS . MacOS , 'myApp.exe' )
51+ ) . toBeUndefined ( ) ;
52+ expect (
53+ checkPlatform ( LEGACY_AVAILABLE_PLATFORMS . Win64 , 'myApp.app.tar.gz' )
54+ ) . toBeUndefined ( ) ;
55+ expect (
56+ checkPlatform (
57+ LEGACY_AVAILABLE_PLATFORMS . Win32 ,
58+ 'myApp.AppImage.tar.gz'
59+ )
60+ ) . toBeUndefined ( ) ;
61+ expect (
62+ checkPlatform ( LEGACY_AVAILABLE_PLATFORMS . Linux , 'myApp.x64.zip' )
63+ ) . toBeUndefined ( ) ;
3164 } ) ;
32- } ) ;
65+ } ) ;
0 commit comments