@@ -8,6 +8,7 @@ import { TENCENT_MIRROR_REGISTRY } from "@vegamo/deepcode-core";
88import { buildSharpInstallArgs , createSharpLoader , type SharpInstallProgress } from "../sharp-loader.js" ;
99
1010const tempDirs : string [ ] = [ ] ;
11+ const SHARP_VERSION = "0.35.3" ;
1112
1213afterEach ( ( ) => {
1314 for ( const dir of tempDirs . splice ( 0 ) ) {
@@ -23,7 +24,7 @@ test("Sharp loader reuses a CLI installation without notifying or installing", a
2324 {
2425 workspaceRoot : storageRoot ,
2526 storageRoot,
26- sharpVersion : "0.34.5" ,
27+ sharpVersion : SHARP_VERSION ,
2728 notifyInstalling : async ( task ) => {
2829 notificationCount += 1 ;
2930 return await task ( ( ) => { } ) ;
@@ -53,7 +54,7 @@ test("Sharp loader installs once for concurrent first calls and reuses the cache
5354 {
5455 workspaceRoot : storageRoot ,
5556 storageRoot,
56- sharpVersion : "0.34.5" ,
57+ sharpVersion : SHARP_VERSION ,
5758 notifyInstalling : async ( task ) => {
5859 notificationCount += 1 ;
5960 return await task ( ( progress ) => progressUpdates . push ( progress ) ) ;
@@ -93,7 +94,7 @@ test("Sharp loader retries installation after a failure", async () => {
9394 {
9495 workspaceRoot : storageRoot ,
9596 storageRoot,
96- sharpVersion : "0.34.5" ,
97+ sharpVersion : SHARP_VERSION ,
9798 notifyInstalling : async ( task ) => await task ( ( ) => { } ) ,
9899 } ,
99100 {
@@ -115,9 +116,19 @@ test("Sharp loader retries installation after a failure", async () => {
115116} ) ;
116117
117118test ( "Sharp install uses the npm mirror" , ( ) => {
118- const args = buildSharpInstallArgs ( "/tmp/sharp" , "0.34.5" ) ;
119+ const args = buildSharpInstallArgs ( "/tmp/sharp" , SHARP_VERSION ) ;
119120
120- assert . deepEqual ( args . slice ( - 5 ) , [ "--registry" , TENCENT_MIRROR_REGISTRY , "--prefix" , "/tmp/sharp" , "sharp@0.34.5" ] ) ;
121+ assert . deepEqual ( args . slice ( - 5 ) , [
122+ "--registry" ,
123+ TENCENT_MIRROR_REGISTRY ,
124+ "--prefix" ,
125+ "/tmp/sharp" ,
126+ `sharp@${ SHARP_VERSION } ` ,
127+ ] ) ;
128+ } ) ;
129+
130+ test ( "Sharp tests run against the declared dependency version" , ( ) => {
131+ assert . equal ( sharp . versions . sharp , SHARP_VERSION ) ;
121132} ) ;
122133
123134function createTempDir ( prefix : string ) : string {
0 commit comments