@@ -42,15 +42,15 @@ it("executes getPackageChangelog without errors", async () => {
4242 ) . resolves . not . toThrowError ( ) ;
4343} ) ;
4444
45- // TODO: Disabled temporarily until we decide on a testing strategy/policy regarding e2e tests
46- test . skip ( "executes getPackageVersionDependencies without errors" , async ( ) => {
47- await expect (
48- dapper . getPackageVersionDependencies (
49- namespaceId ,
50- packageName ,
51- packageVersion
52- )
53- ) . resolves . not . toThrowError ( ) ;
45+ test ( "executes getPackageVersionDependencies without errors" , async ( ) => {
46+ const response = await dapper . getPackageVersionDependencies (
47+ namespaceId ,
48+ packageName ,
49+ packageVersion
50+ ) ;
51+
52+ expect ( response . count ) . toBeTypeOf ( "number" ) ;
53+ expect ( Array . isArray ( response . results ) ) . toBe ( true ) ;
5454} ) ;
5555
5656it ( "executes getPackageListingDetails without errors" , async ( ) => {
@@ -81,11 +81,27 @@ it("executes getPackageReadme without errors", async () => {
8181 ) . resolves . not . toThrowError ( ) ;
8282} ) ;
8383
84- // TODO: Disabled temporarily until we decide on a testing strategy/policy regarding e2e tests
85- test . skip ( "executes getPackageSource without errors" , async ( ) => {
86- await expect (
87- dapper . getPackageSource ( namespaceId , packageName )
88- ) . resolves . not . toThrowError ( ) ;
84+ test ( "executes getPackageSource when enabled (or 404 when disabled)" , async ( ) => {
85+ try {
86+ const response = await dapper . getPackageSource ( namespaceId , packageName ) ;
87+
88+ // If the endpoint exists in the backend image, validate a minimal shape.
89+ expect ( response ) . toBeTruthy ( ) ;
90+ expect ( response ) . toHaveProperty ( "namespace" ) ;
91+ expect ( response ) . toHaveProperty ( "package_name" ) ;
92+ expect ( response ) . toHaveProperty ( "version_number" ) ;
93+ expect ( response ) . toHaveProperty ( "is_visible" ) ;
94+ expect ( response ) . toHaveProperty ( "decompilations" ) ;
95+ expect ( Array . isArray ( response . decompilations ) ) . toBe ( true ) ;
96+ } catch ( err ) {
97+ // The test backend image used for containerized tests may not include the
98+ // plugin that registers this endpoint. Treat a 404 as "endpoint disabled".
99+ if ( err instanceof Error && err . message . includes ( "404" ) ) {
100+ return ;
101+ }
102+
103+ throw err ;
104+ }
89105} ) ;
90106
91107it ( "executes getPackageVersions without errors" , async ( ) => {
0 commit comments