1
+ /* eslint-disable no-console */
1
2
import { afterEach , beforeEach , describe , expect , it } from 'bun:test'
2
3
import { spawn } from 'node:child_process'
3
4
import fs from 'node:fs'
@@ -57,6 +58,12 @@ describe('clean command - service shutdown behavior', () => {
57
58
} )
58
59
59
60
it ( 'dry-run should show services that would be stopped' , async ( ) => {
61
+ // Skip on non-macOS platforms where service management differs
62
+ if ( process . platform !== 'darwin' ) {
63
+ console . log ( 'Skipping macOS-specific service test on' , process . platform )
64
+ return
65
+ }
66
+
60
67
// Prepare a fake user LaunchAgents with a Launchpad plist to simulate a registered service
61
68
const launchAgents = path . join ( process . env . HOME ! , 'Library' , 'LaunchAgents' )
62
69
fs . mkdirSync ( launchAgents , { recursive : true } )
@@ -77,6 +84,12 @@ describe('clean command - service shutdown behavior', () => {
77
84
} )
78
85
79
86
it ( 'should stop, disable and remove service files before cleaning (keep-global respected)' , async ( ) => {
87
+ // Skip on non-macOS platforms where service management differs
88
+ if ( process . platform !== 'darwin' ) {
89
+ console . log ( 'Skipping macOS-specific service test on' , process . platform )
90
+ return
91
+ }
92
+
80
93
// Create a deps.yaml that marks postgres as global to ensure we do not stop it with --keep-global
81
94
const dotfiles = path . join ( process . env . HOME ! , '.dotfiles' )
82
95
fs . mkdirSync ( dotfiles , { recursive : true } )
0 commit comments