@@ -1648,13 +1648,9 @@ describe("updateNpmInstalledPlugins", () => {
16481648 dryRun : true ,
16491649 } ) ;
16501650
1651- expect ( installPluginFromNpmSpecMock ) . toHaveBeenCalledWith (
1652- expect . objectContaining ( {
1653- spec : "@acme/demo" ,
1654- expectedPluginId : "demo" ,
1655- dryRun : true ,
1656- } ) ,
1657- ) ;
1651+ expect ( npmInstallCall ( ) ?. spec ) . toBe ( "@acme/demo" ) ;
1652+ expect ( npmInstallCall ( ) ?. expectedPluginId ) . toBe ( "demo" ) ;
1653+ expect ( npmInstallCall ( ) ?. dryRun ) . toBe ( true ) ;
16581654 expect ( result . changed ) . toBe ( false ) ;
16591655 expect ( result . config ) . toBe ( config ) ;
16601656 expect ( result . outcomes ) . toEqual ( [
@@ -1697,12 +1693,8 @@ describe("updateNpmInstalledPlugins", () => {
16971693 logger : { warn } ,
16981694 } ) ;
16991695
1700- expect ( installPluginFromNpmSpecMock ) . toHaveBeenCalledWith (
1701- expect . objectContaining ( {
1702- spec : "@acme/demo" ,
1703- expectedPluginId : "demo" ,
1704- } ) ,
1705- ) ;
1696+ expect ( npmInstallCall ( ) ?. spec ) . toBe ( "@acme/demo" ) ;
1697+ expect ( npmInstallCall ( ) ?. expectedPluginId ) . toBe ( "demo" ) ;
17061698 const message =
17071699 'Disabled "demo" after plugin update failure; OpenClaw will continue without it. Failed to update demo: registry timeout' ;
17081700 expect ( warn ) . toHaveBeenCalledWith ( message ) ;
@@ -1961,18 +1953,8 @@ describe("updateNpmInstalledPlugins", () => {
19611953 logger : { warn : ( msg ) => warnMessages . push ( msg ) } ,
19621954 } ) ;
19631955
1964- expect ( installPluginFromNpmSpecMock ) . toHaveBeenNthCalledWith (
1965- 1 ,
1966- expect . objectContaining ( {
1967- spec : "openclaw-codex-app-server@beta" ,
1968- } ) ,
1969- ) ;
1970- expect ( installPluginFromNpmSpecMock ) . toHaveBeenNthCalledWith (
1971- 2 ,
1972- expect . objectContaining ( {
1973- spec : "openclaw-codex-app-server" ,
1974- } ) ,
1975- ) ;
1956+ expect ( npmInstallCall ( 0 ) ?. spec ) . toBe ( "openclaw-codex-app-server@beta" ) ;
1957+ expect ( npmInstallCall ( 1 ) ?. spec ) . toBe ( "openclaw-codex-app-server" ) ;
19761958 expect ( warnMessages ) . toEqual ( [ expect . stringContaining ( "has no beta npm release" ) ] ) ;
19771959 expectCodexAppServerInstallState ( {
19781960 result,
@@ -2011,18 +1993,8 @@ describe("updateNpmInstalledPlugins", () => {
20111993 logger : { warn : ( msg ) => warnMessages . push ( msg ) } ,
20121994 } ) ;
20131995
2014- expect ( installPluginFromNpmSpecMock ) . toHaveBeenNthCalledWith (
2015- 1 ,
2016- expect . objectContaining ( {
2017- spec : "openclaw-codex-app-server@beta" ,
2018- } ) ,
2019- ) ;
2020- expect ( installPluginFromNpmSpecMock ) . toHaveBeenNthCalledWith (
2021- 2 ,
2022- expect . objectContaining ( {
2023- spec : "openclaw-codex-app-server" ,
2024- } ) ,
2025- ) ;
1996+ expect ( npmInstallCall ( 0 ) ?. spec ) . toBe ( "openclaw-codex-app-server@beta" ) ;
1997+ expect ( npmInstallCall ( 1 ) ?. spec ) . toBe ( "openclaw-codex-app-server" ) ;
20261998 expect ( warnMessages ) . toEqual ( [ expect . stringContaining ( "failed beta npm update" ) ] ) ;
20271999 expectCodexAppServerInstallState ( {
20282000 result,
@@ -2126,16 +2098,12 @@ describe("updateNpmInstalledPlugins", () => {
21262098 timeoutMs : 1_800_000 ,
21272099 } ) ;
21282100
2129- expect ( installPluginFromClawHubMock ) . toHaveBeenCalledWith (
2130- expect . objectContaining ( {
2131- spec : "clawhub:demo" ,
2132- baseUrl : "https://clawhub.ai" ,
2133- expectedPluginId : "demo" ,
2134- mode : "update" ,
2135- timeoutMs : 1_800_000 ,
2136- } ) ,
2137- ) ;
2138- expect ( result . config . plugins ?. installs ?. demo ) . toMatchObject ( {
2101+ expect ( clawHubInstallCall ( ) ?. spec ) . toBe ( "clawhub:demo" ) ;
2102+ expect ( clawHubInstallCall ( ) ?. baseUrl ) . toBe ( "https://clawhub.ai" ) ;
2103+ expect ( clawHubInstallCall ( ) ?. expectedPluginId ) . toBe ( "demo" ) ;
2104+ expect ( clawHubInstallCall ( ) ?. mode ) . toBe ( "update" ) ;
2105+ expect ( clawHubInstallCall ( ) ?. timeoutMs ) . toBe ( 1_800_000 ) ;
2106+ expectRecordFields ( result . config . plugins ?. installs ?. demo , {
21392107 source : "clawhub" ,
21402108 spec : "clawhub:demo" ,
21412109 installPath : "/tmp/demo" ,
@@ -2179,14 +2147,10 @@ describe("updateNpmInstalledPlugins", () => {
21792147 updateChannel : "beta" ,
21802148 } ) ;
21812149
2182- expect ( installPluginFromClawHubMock ) . toHaveBeenCalledWith (
2183- expect . objectContaining ( {
2184- spec : "clawhub:demo@beta" ,
2185- baseUrl : "https://clawhub.ai" ,
2186- expectedPluginId : "demo" ,
2187- } ) ,
2188- ) ;
2189- expect ( result . config . plugins ?. installs ?. demo ) . toMatchObject ( {
2150+ expect ( clawHubInstallCall ( ) ?. spec ) . toBe ( "clawhub:demo@beta" ) ;
2151+ expect ( clawHubInstallCall ( ) ?. baseUrl ) . toBe ( "https://clawhub.ai" ) ;
2152+ expect ( clawHubInstallCall ( ) ?. expectedPluginId ) . toBe ( "demo" ) ;
2153+ expectRecordFields ( result . config . plugins ?. installs ?. demo , {
21902154 source : "clawhub" ,
21912155 spec : "clawhub:demo" ,
21922156 installPath : "/tmp/demo" ,
@@ -2226,20 +2190,10 @@ describe("updateNpmInstalledPlugins", () => {
22262190 logger : { warn : ( msg ) => warnMessages . push ( msg ) } ,
22272191 } ) ;
22282192
2229- expect ( installPluginFromClawHubMock ) . toHaveBeenNthCalledWith (
2230- 1 ,
2231- expect . objectContaining ( {
2232- spec : "clawhub:demo@beta" ,
2233- } ) ,
2234- ) ;
2235- expect ( installPluginFromClawHubMock ) . toHaveBeenNthCalledWith (
2236- 2 ,
2237- expect . objectContaining ( {
2238- spec : "clawhub:demo" ,
2239- } ) ,
2240- ) ;
2193+ expect ( clawHubInstallCall ( 0 ) ?. spec ) . toBe ( "clawhub:demo@beta" ) ;
2194+ expect ( clawHubInstallCall ( 1 ) ?. spec ) . toBe ( "clawhub:demo" ) ;
22412195 expect ( warnMessages ) . toEqual ( [ expect . stringContaining ( "has no beta ClawHub release" ) ] ) ;
2242- expect ( result . config . plugins ?. installs ?. demo ) . toMatchObject ( {
2196+ expectRecordFields ( result . config . plugins ?. installs ?. demo , {
22432197 source : "clawhub" ,
22442198 spec : "clawhub:demo" ,
22452199 installPath : "/tmp/demo" ,
0 commit comments