mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Add focused regression tests for the environment helper and Stork binary target selection so the Ubuntu 24 and Apple Silicon path stays protected.
24 lines
659 B
JavaScript
24 lines
659 B
JavaScript
import { describe, expect, it } from 'vitest'
|
|
|
|
import {
|
|
isBrowserContext,
|
|
isDarwin,
|
|
isLinux
|
|
} from '~/helpers/environment.js'
|
|
|
|
describe( 'environment helpers', () => {
|
|
it( 'does not treat Node 22 navigator as a browser runtime', () => {
|
|
expect( isBrowserContext() ).toBe( false )
|
|
})
|
|
|
|
it( 'detects darwin directly from process.platform', () => {
|
|
expect( isDarwin() ).toBe( process.platform === 'darwin' )
|
|
})
|
|
|
|
it( 'detects linux-like runtimes directly from process.platform', () => {
|
|
expect( isLinux() ).toBe([
|
|
'linux',
|
|
'openbsd'
|
|
].includes( process.platform ) )
|
|
})
|
|
})
|