@@ -15,6 +15,76 @@ describe("updateNpmInstalledPlugins", () => {
1515 installPluginFromNpmSpecMock . mockReset ( ) ;
1616 } ) ;
1717
18+ it ( "skips integrity drift checks for unpinned npm specs during dry-run updates" , async ( ) => {
19+ installPluginFromNpmSpecMock . mockResolvedValue ( {
20+ ok : true ,
21+ pluginId : "opik-openclaw" ,
22+ targetDir : "/tmp/opik-openclaw" ,
23+ version : "0.2.6" ,
24+ extensions : [ "index.ts" ] ,
25+ } ) ;
26+
27+ const { updateNpmInstalledPlugins } = await import ( "./update.js" ) ;
28+ await updateNpmInstalledPlugins ( {
29+ config : {
30+ plugins : {
31+ installs : {
32+ "opik-openclaw" : {
33+ source : "npm" ,
34+ spec : "@opik/opik-openclaw" ,
35+ integrity : "sha512-old" ,
36+ installPath : "/tmp/opik-openclaw" ,
37+ } ,
38+ } ,
39+ } ,
40+ } ,
41+ pluginIds : [ "opik-openclaw" ] ,
42+ dryRun : true ,
43+ } ) ;
44+
45+ expect ( installPluginFromNpmSpecMock ) . toHaveBeenCalledWith (
46+ expect . objectContaining ( {
47+ spec : "@opik/opik-openclaw" ,
48+ expectedIntegrity : undefined ,
49+ } ) ,
50+ ) ;
51+ } ) ;
52+
53+ it ( "keeps integrity drift checks for exact-version npm specs during dry-run updates" , async ( ) => {
54+ installPluginFromNpmSpecMock . mockResolvedValue ( {
55+ ok : true ,
56+ pluginId : "opik-openclaw" ,
57+ targetDir : "/tmp/opik-openclaw" ,
58+ version : "0.2.6" ,
59+ extensions : [ "index.ts" ] ,
60+ } ) ;
61+
62+ const { updateNpmInstalledPlugins } = await import ( "./update.js" ) ;
63+ await updateNpmInstalledPlugins ( {
64+ config : {
65+ plugins : {
66+ installs : {
67+ "opik-openclaw" : {
68+ source : "npm" ,
69+ 70+ integrity : "sha512-old" ,
71+ installPath : "/tmp/opik-openclaw" ,
72+ } ,
73+ } ,
74+ } ,
75+ } ,
76+ pluginIds : [ "opik-openclaw" ] ,
77+ dryRun : true ,
78+ } ) ;
79+
80+ expect ( installPluginFromNpmSpecMock ) . toHaveBeenCalledWith (
81+ expect . objectContaining ( {
82+ 83+ expectedIntegrity : "sha512-old" ,
84+ } ) ,
85+ ) ;
86+ } ) ;
87+
1888 it ( "formats package-not-found updates with a stable message" , async ( ) => {
1989 installPluginFromNpmSpecMock . mockResolvedValue ( {
2090 ok : false ,
0 commit comments