File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ import os from 'os'
2
+ import { platform } from '../src/core'
3
+
4
+ describe ( 'getInfo' , ( ) => {
5
+ it ( 'returns the platform info' , async ( ) => {
6
+ const info = await platform . getDetails ( )
7
+ expect ( info ) . toEqual ( {
8
+ name : expect . any ( String ) ,
9
+ platform : expect . any ( String ) ,
10
+ arch : expect . any ( String ) ,
11
+ version : expect . any ( String ) ,
12
+ isWindows : expect . any ( Boolean ) ,
13
+ isMacOS : expect . any ( Boolean ) ,
14
+ isLinux : expect . any ( Boolean )
15
+ } )
16
+ } )
17
+
18
+ it ( 'returns the platform info with the correct name' , async ( ) => {
19
+ const isWindows = os . platform ( ) === 'win32'
20
+ const isMacOS = os . platform ( ) === 'darwin'
21
+ const isLinux = os . platform ( ) === 'linux'
22
+
23
+ const info = await platform . getDetails ( )
24
+ expect ( info . platform ) . toEqual ( os . platform ( ) )
25
+ expect ( info . isWindows ) . toEqual ( isWindows )
26
+ expect ( info . isMacOS ) . toEqual ( isMacOS )
27
+ expect ( info . isLinux ) . toEqual ( isLinux )
28
+ } )
29
+ } )
You can’t perform that action at this time.
0 commit comments