Skip to content

Commit 0684774

Browse files
committed
Prettier
1 parent 4e1944f commit 0684774

File tree

2 files changed

+71
-22
lines changed

2 files changed

+71
-22
lines changed

src/legacy/checkPlatform.test.ts

Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,62 @@ import { describe, it, expect } from 'vitest';
44

55
describe('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+
});

src/legacy/validatePlatform.test.ts

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,33 @@ import { describe, it, expect } from 'vitest';
44

55
describe('validatePlatform', () => {
66
it('should return the platform if it is valid using enum', () => {
7-
expect(validatePlatform(LEGACY_AVAILABLE_PLATFORMS.MacOS)).toBe(LEGACY_AVAILABLE_PLATFORMS.MacOS);
8-
expect(validatePlatform(LEGACY_AVAILABLE_PLATFORMS.Win32)).toBe(LEGACY_AVAILABLE_PLATFORMS.Win32);
9-
expect(validatePlatform(LEGACY_AVAILABLE_PLATFORMS.Win64)).toBe(LEGACY_AVAILABLE_PLATFORMS.Win64);
10-
expect(validatePlatform(LEGACY_AVAILABLE_PLATFORMS.Linux)).toBe(LEGACY_AVAILABLE_PLATFORMS.Linux);
7+
expect(validatePlatform(LEGACY_AVAILABLE_PLATFORMS.MacOS)).toBe(
8+
LEGACY_AVAILABLE_PLATFORMS.MacOS
9+
);
10+
expect(validatePlatform(LEGACY_AVAILABLE_PLATFORMS.Win32)).toBe(
11+
LEGACY_AVAILABLE_PLATFORMS.Win32
12+
);
13+
expect(validatePlatform(LEGACY_AVAILABLE_PLATFORMS.Win64)).toBe(
14+
LEGACY_AVAILABLE_PLATFORMS.Win64
15+
);
16+
expect(validatePlatform(LEGACY_AVAILABLE_PLATFORMS.Linux)).toBe(
17+
LEGACY_AVAILABLE_PLATFORMS.Linux
18+
);
1119
});
1220

1321
it('should return the platform if it is valid using string', () => {
14-
expect(validatePlatform('darwin')).toBe(LEGACY_AVAILABLE_PLATFORMS.MacOS);
15-
expect(validatePlatform('win32')).toBe(LEGACY_AVAILABLE_PLATFORMS.Win32);
16-
expect(validatePlatform('win64')).toBe(LEGACY_AVAILABLE_PLATFORMS.Win64);
17-
expect(validatePlatform('linux')).toBe(LEGACY_AVAILABLE_PLATFORMS.Linux);
22+
expect(validatePlatform('darwin')).toBe(
23+
LEGACY_AVAILABLE_PLATFORMS.MacOS
24+
);
25+
expect(validatePlatform('win32')).toBe(
26+
LEGACY_AVAILABLE_PLATFORMS.Win32
27+
);
28+
expect(validatePlatform('win64')).toBe(
29+
LEGACY_AVAILABLE_PLATFORMS.Win64
30+
);
31+
expect(validatePlatform('linux')).toBe(
32+
LEGACY_AVAILABLE_PLATFORMS.Linux
33+
);
1834
});
1935

2036
it('should return undefined if the platform is not valid', () => {
@@ -23,4 +39,4 @@ describe('validatePlatform', () => {
2339
expect(validatePlatform('Win64')).toBeUndefined();
2440
expect(validatePlatform('Mac')).toBeUndefined();
2541
});
26-
});
42+
});

0 commit comments

Comments
 (0)