@@ -4,7 +4,7 @@ import { MESSAGE_SEVERITY, VALIDATION_RULES_SEVERITY_LEVEL_ERROR } from '../src'
44describe ( 'Reference bundling test' , ( ) => {
55 test ( 'external references should be bundled' , async ( ) => {
66 const pkg = LocalRegistry . openPackage ( 'reference-bundling/case1' )
7- const result = await pkg . publish ( pkg . packageId , { packageId : pkg . packageId } )
7+ const result = await pkg . publish ( pkg . packageId )
88
99 expect ( result . documents . get ( 'openapi.yaml' ) ?. dependencies ) . toEqual ( [ 'reference.yaml' ] )
1010 } )
@@ -14,17 +14,14 @@ describe('Reference bundling test', () => {
1414
1515 await expect (
1616 pkg . publish ( pkg . packageId , {
17- packageId : pkg . packageId ,
1817 validationRulesSeverity : { brokenRefs : VALIDATION_RULES_SEVERITY_LEVEL_ERROR } ,
1918 } ) ,
2019 ) . rejects . toThrow ( / d o e s n o t e x i s t / )
2120 } )
2221
2322 test ( 'should not throw on missing external reference' , async ( ) => {
2423 const pkg = LocalRegistry . openPackage ( 'reference-bundling/case2' )
25- const result = await pkg . publish ( pkg . packageId , {
26- packageId : pkg . packageId ,
27- } )
24+ const result = await pkg . publish ( pkg . packageId )
2825
2926 expect ( result . notifications . filter ( ( { severity } ) => severity === MESSAGE_SEVERITY . Error ) . length ) . toEqual ( 2 )
3027 expect ( result . operations . size ) . toBe ( 1 )
@@ -33,7 +30,7 @@ describe('Reference bundling test', () => {
3330
3431 test ( 'transitive external references should be bundled' , async ( ) => {
3532 const pkg = LocalRegistry . openPackage ( 'reference-bundling/case3' )
36- const result = await pkg . publish ( pkg . packageId , { packageId : pkg . packageId } )
33+ const result = await pkg . publish ( pkg . packageId )
3734
3835 expect ( result . documents . get ( 'openapi.yaml' ) ?. dependencies ) . toEqual ( [
3936 'reference.yaml' ,
@@ -46,17 +43,14 @@ describe('Reference bundling test', () => {
4643
4744 await expect (
4845 pkg . publish ( pkg . packageId , {
49- packageId : pkg . packageId ,
5046 validationRulesSeverity : { brokenRefs : VALIDATION_RULES_SEVERITY_LEVEL_ERROR } ,
5147 } ) ,
5248 ) . rejects . toThrow ( / d o e s n o t e x i s t / )
5349 } )
5450
5551 test ( 'should not throw on missing transitive external reference' , async ( ) => {
5652 const pkg = LocalRegistry . openPackage ( 'reference-bundling/case4' )
57- const result = await pkg . publish ( pkg . packageId , {
58- packageId : pkg . packageId ,
59- } )
53+ const result = await pkg . publish ( pkg . packageId )
6054
6155 expect ( result . notifications . filter ( ( { severity } ) => severity === MESSAGE_SEVERITY . Error ) . length ) . toEqual ( 2 )
6256 expect ( result . operations . size ) . toBe ( 1 )
@@ -68,17 +62,14 @@ describe('Reference bundling test', () => {
6862
6963 await expect (
7064 pkg . publish ( pkg . packageId , {
71- packageId : pkg . packageId ,
7265 validationRulesSeverity : { brokenRefs : VALIDATION_RULES_SEVERITY_LEVEL_ERROR } ,
7366 } ) ,
7467 ) . rejects . toThrow ( / r e f e r e n c e s a n i n v a l i d l o c a t i o n / )
7568 } )
7669
7770 test ( 'should not throw on missing internal reference' , async ( ) => {
7871 const pkg = LocalRegistry . openPackage ( 'reference-bundling/case5' )
79- const result = await pkg . publish ( pkg . packageId , {
80- packageId : pkg . packageId ,
81- } )
72+ const result = await pkg . publish ( pkg . packageId )
8273
8374 expect ( result . notifications . filter ( ( { severity } ) => severity === MESSAGE_SEVERITY . Error ) . length ) . toEqual ( 1 )
8475 expect ( result . operations . size ) . toBe ( 1 )
@@ -88,7 +79,6 @@ describe('Reference bundling test', () => {
8879 const pkg = LocalRegistry . openPackage ( 'reference-bundling/case6' )
8980 await expect (
9081 pkg . publish ( pkg . packageId , {
91- packageId : pkg . packageId ,
9282 validationRulesSeverity : { brokenRefs : VALIDATION_RULES_SEVERITY_LEVEL_ERROR } ,
9383 } ) ,
9484 ) . rejects . toThrow ( / n o t a v a l i d t e x t f i l e / )
0 commit comments