File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { describe , expect , it } from 'vitest'
2+
3+ import {
4+ isBrowserContext ,
5+ isDarwin ,
6+ isLinux
7+ } from '~/helpers/environment.js'
8+
9+ describe ( 'environment helpers' , ( ) => {
10+ it ( 'does not treat Node 22 navigator as a browser runtime' , ( ) => {
11+ expect ( isBrowserContext ( ) ) . toBe ( false )
12+ } )
13+
14+ it ( 'detects darwin directly from process.platform' , ( ) => {
15+ expect ( isDarwin ( ) ) . toBe ( process . platform === 'darwin' )
16+ } )
17+
18+ it ( 'detects linux-like runtimes directly from process.platform' , ( ) => {
19+ expect ( isLinux ( ) ) . toBe ( [
20+ 'linux' ,
21+ 'openbsd'
22+ ] . includes ( process . platform ) )
23+ } )
24+ } )
Original file line number Diff line number Diff line change 1+ import { describe , expect , it } from 'vitest'
2+
3+ import {
4+ getStorkExecutableTarget ,
5+ getStorkExecutableDownloadUrl
6+ } from '~/helpers/stork/executable.js'
7+
8+ describe ( 'stork executable selection' , ( ) => {
9+ it ( 'uses the Ubuntu 22.04 binary for Linux builds' , ( ) => {
10+ expect ( getStorkExecutableTarget ( {
11+ platform : 'linux' ,
12+ arch : 'x64'
13+ } ) ) . toBe ( 'stork-ubuntu-22-04' )
14+ } )
15+
16+ it ( 'uses the Apple Silicon macOS binary on arm64 Macs' , ( ) => {
17+ expect ( getStorkExecutableTarget ( {
18+ platform : 'darwin' ,
19+ arch : 'arm64'
20+ } ) ) . toBe ( 'stork-macos-13-arm' )
21+ } )
22+
23+ it ( 'builds the download URL from the selected target' , ( ) => {
24+ expect ( getStorkExecutableDownloadUrl ( {
25+ platform : 'linux' ,
26+ arch : 'x64'
27+ } ) ) . toContain ( '/stork-ubuntu-22-04' )
28+ } )
29+ } )
You can’t perform that action at this time.
0 commit comments