@@ -161,6 +161,27 @@ describe('Linux Stage 0 pipeline', () => {
161161 )
162162 } )
163163
164+ it ( 'previews Arch pacman prerequisites and Stage 1 handoff' , async ( ) => {
165+ const workspace = createWorkspace ( 'arch' )
166+ const result = await execa (
167+ 'bash' ,
168+ [ path . join ( repoRoot , 'linux/00quickstart.sh' ) , '--dry-run' ] ,
169+ {
170+ env : linuxEnv ( workspace , {
171+ POWERSHELL_SCRIPTS_FORCE_MISSING_PACMAN_PREREQUISITES : '1' ,
172+ } ) ,
173+ reject : false ,
174+ } ,
175+ )
176+
177+ expect ( result . exitCode ) . toBe ( 0 )
178+ expect ( result . stdout ) . toContain (
179+ 'pacman -Syu --needed --noconfirm base-devel ca-certificates curl git' ,
180+ )
181+ expect ( result . stdout ) . toContain ( '02installPowerShell.sh' )
182+ expect ( result . stdout ) . toContain ( '-Preset Core' )
183+ } )
184+
164185 it ( 'previews Linuxbrew and PowerShell without installing' , async ( ) => {
165186 const workspace = createWorkspace ( )
166187 const brew = await execa (
@@ -208,7 +229,47 @@ describe('Linux Stage 0 pipeline', () => {
208229 )
209230
210231 expect ( result . exitCode ) . toBe ( 10 )
211- expect ( result . stderr ) . toContain ( '请提供本地 deb 或预装 PowerShell 7' )
232+ expect ( result . stderr ) . toContain ( '请提供本地安装包或预装 PowerShell 7' )
233+ } )
234+
235+ it ( 'previews the official PowerShell tarball path on Arch' , async ( ) => {
236+ const workspace = createWorkspace ( 'arch' )
237+ const result = await execa (
238+ 'bash' ,
239+ [ path . join ( repoRoot , 'linux/02installPowerShell.sh' ) , '--dry-run' ] ,
240+ {
241+ env : linuxEnv ( workspace , {
242+ POWERSHELL_SCRIPTS_FORCE_MISSING_PWSH : '1' ,
243+ } ) ,
244+ reject : false ,
245+ } ,
246+ )
247+
248+ expect ( result . exitCode ) . toBe ( 0 )
249+ expect ( result . stdout ) . toContain ( 'linux-x64 tarball' )
250+ expect ( result . stdout ) . toContain ( 'SHA256' )
251+ expect ( result . stdout ) . toContain ( '/opt/microsoft/powershell/7' )
252+ } )
253+
254+ it ( 'previews optional yay without cloning or writing' , async ( ) => {
255+ const workspace = createWorkspace ( 'arch' )
256+ const result = await execa (
257+ 'bash' ,
258+ [ path . join ( repoRoot , 'linux/arch/installYay.sh' ) , '--dry-run' ] ,
259+ {
260+ env : linuxEnv ( workspace , {
261+ POWERSHELL_SCRIPTS_FORCE_MISSING_YAY : '1' ,
262+ } ) ,
263+ reject : false ,
264+ } ,
265+ )
266+
267+ expect ( result . exitCode ) . toBe ( 0 )
268+ expect ( result . stdout ) . toContain (
269+ 'pacman -S --needed --noconfirm base-devel git' ,
270+ )
271+ expect ( result . stdout ) . toContain ( 'aur.archlinux.org/yay.git' )
272+ expect ( result . stdout ) . toContain ( 'makepkg -si --needed --noconfirm' )
212273 } )
213274} )
214275
@@ -292,7 +353,7 @@ describe('Linux Stage 1 shell wrappers', () => {
292353 `source "${ path . join ( repoRoot , 'shell/shared.d/homebrew.sh' ) } "; printf '%s\\n%s' "$HOMEBREW_PREFIX" "$PATH"` ,
293354 ] ,
294355 {
295- // 显式指定 prefix,跳过路径探测,避免 CI(如 ubuntu-latest 预装的系统级 Linuxbrew) 干扰隔离 fixture。
356+ // 显式指定 prefix,跳过路径探测,避免 CI 预装的系统级 Linuxbrew 干扰隔离 fixture。
296357 env : linuxEnv ( workspace , {
297358 POWERSHELL_SCRIPTS_HOMEBREW_PREFIX : prefix ,
298359 } ) ,
0 commit comments