11import outdent from 'outdent' ;
22import * as path from 'node:path' ;
33import { fileURLToPath } from 'node:url' ;
4- import { bundleOas , loadConfig } from '../bundle/bundle-oas.js' ;
4+ import { bundleOas , createEmptyRedoclyConfig } from '../bundle/bundle-oas.js' ;
55import { parseYamlToDocument , yamlSerializer } from '../../__tests__/utils.js' ;
6- import { createConfig } from '../config/index.js' ;
76import { BaseResolver } from '../resolve.js' ;
87
98const __dirname = path . dirname ( fileURLToPath ( import . meta. url ) ) ;
@@ -44,7 +43,7 @@ describe('bundle-oas', () => {
4443
4544 it ( 'should bundle external refs' , async ( ) => {
4645 const { bundle : res , problems } = await bundleOas ( {
47- config : await createConfig ( { } ) ,
46+ config : await createEmptyRedoclyConfig ( { } ) ,
4847 ref : path . join ( __dirname , 'fixtures/refs/openapi-with-external-refs.yaml' ) ,
4948 } ) ;
5049 expect ( problems ) . toHaveLength ( 0 ) ;
@@ -53,7 +52,7 @@ describe('bundle-oas', () => {
5352
5453 it ( 'should bundle external refs and warn for conflicting names' , async ( ) => {
5554 const { bundle : res , problems } = await bundleOas ( {
56- config : await createConfig ( { } ) ,
55+ config : await createEmptyRedoclyConfig ( { } ) ,
5756 ref : path . join ( __dirname , 'fixtures/refs/openapi-with-external-refs-conflicting-names.yaml' ) ,
5857 } ) ;
5958 expect ( problems ) . toHaveLength ( 1 ) ;
@@ -65,7 +64,7 @@ describe('bundle-oas', () => {
6564
6665 it ( 'should place referenced schema inline when referenced schema name resolves to original schema name' , async ( ) => {
6766 const { bundle : res , problems } = await bundleOas ( {
68- config : await createConfig ( { } ) ,
67+ config : await createEmptyRedoclyConfig ( { } ) ,
6968 ref : path . join ( __dirname , 'fixtures/refs/externalref.yaml' ) ,
7069 } ) ;
7170
@@ -75,7 +74,7 @@ describe('bundle-oas', () => {
7574
7675 it ( 'should not place referenced schema inline when component in question is not of type "schemas"' , async ( ) => {
7776 const { bundle : res , problems } = await bundleOas ( {
78- config : await createConfig ( { } ) ,
77+ config : await createEmptyRedoclyConfig ( { } ) ,
7978 ref : path . join ( __dirname , 'fixtures/refs/external-request-body.yaml' ) ,
8079 } ) ;
8180
@@ -85,7 +84,7 @@ describe('bundle-oas', () => {
8584
8685 it ( 'should pull hosted schema' , async ( ) => {
8786 const { bundle : res , problems } = await bundleOas ( {
88- config : await createConfig ( { } ) ,
87+ config : await createEmptyRedoclyConfig ( { } ) ,
8988 externalRefResolver : new BaseResolver ( {
9089 http : {
9190 customFetch : fetchMock ,
@@ -104,7 +103,7 @@ describe('bundle-oas', () => {
104103
105104 it ( 'should not bundle url refs if used with keepUrlRefs' , async ( ) => {
106105 const { bundle : res , problems } = await bundleOas ( {
107- config : await createConfig ( { } ) ,
106+ config : await createEmptyRedoclyConfig ( { } ) ,
108107 externalRefResolver : new BaseResolver ( {
109108 http : {
110109 customFetch : fetchMock ,
@@ -119,7 +118,7 @@ describe('bundle-oas', () => {
119118 } ) ;
120119
121120 it ( 'should throw an error when there is no document to bundle' , async ( ) => {
122- const config = await createConfig ( { } ) ;
121+ const config = await createEmptyRedoclyConfig ( { } ) ;
123122 const wrapper = ( ) =>
124123 bundleOas ( {
125124 config,
@@ -133,7 +132,9 @@ describe('bundle-oas', () => {
133132 bundle : { parsed } ,
134133 problems,
135134 } = await bundleOas ( {
136- config : await loadConfig ( { configPath : path . join ( __dirname , 'fixtures/redocly.yaml' ) } ) ,
135+ config : await createEmptyRedoclyConfig ( {
136+ configPath : path . join ( __dirname , 'fixtures/redocly.yaml' ) ,
137+ } ) ,
137138 doc : testDocument ,
138139 } ) ;
139140
@@ -145,7 +146,7 @@ describe('bundle-oas', () => {
145146
146147 it ( 'should bundle schemas with properties named $ref and externalValues correctly' , async ( ) => {
147148 const { bundle : res , problems } = await bundleOas ( {
148- config : await createConfig ( { } ) ,
149+ config : await createEmptyRedoclyConfig ( { } ) ,
149150 ref : path . join ( __dirname , 'fixtures/refs/openapi-with-special-names-in-props.yaml' ) ,
150151 } ) ;
151152 expect ( problems ) . toHaveLength ( 0 ) ;
@@ -154,15 +155,15 @@ describe('bundle-oas', () => {
154155
155156 it ( 'should normalize self-file explicit $ref in oas2' , async ( ) => {
156157 const { bundle : res , problems } = await bundleOas ( {
157- config : await createConfig ( { } ) ,
158+ config : await createEmptyRedoclyConfig ( { } ) ,
158159 ref : path . join ( __dirname , 'fixtures/self-file-refs/oas2.yaml' ) ,
159160 } ) ;
160161 expect ( problems ) . toHaveLength ( 0 ) ;
161162 expect ( res . parsed ) . toMatchSnapshot ( ) ;
162163 } ) ;
163164
164165 it ( 'should normalize self-file explicit $ref in nested referenced file' , async ( ) => {
165- const config = await createConfig ( { } ) ;
166+ const config = await createEmptyRedoclyConfig ( { } ) ;
166167
167168 const { bundle : res , problems } = await bundleOas ( {
168169 config,
0 commit comments