@@ -38,6 +38,20 @@ describe('dts when bundle: false', () => {
3838 expect ( files . esm ) . toMatchInlineSnapshot ( 'undefined' ) ;
3939 } ) ;
4040
41+ test ( 'dts true' , async ( ) => {
42+ const fixturePath = join ( __dirname , 'bundle-false' , 'true' ) ;
43+ const { files } = await buildAndGetResults ( { fixturePath, type : 'dts' } ) ;
44+
45+ expect ( files . esm ) . toMatchInlineSnapshot ( `
46+ [
47+ "<ROOT>/tests/integration/dts/bundle-false/true/dist/esm/index.d.ts",
48+ "<ROOT>/tests/integration/dts/bundle-false/true/dist/esm/sum.d.ts",
49+ "<ROOT>/tests/integration/dts/bundle-false/true/dist/esm/utils/numbers.d.ts",
50+ "<ROOT>/tests/integration/dts/bundle-false/true/dist/esm/utils/strings.d.ts",
51+ ]
52+ ` ) ;
53+ } ) ;
54+
4155 test ( 'distPath' , async ( ) => {
4256 const fixturePath = join ( __dirname , 'bundle-false' , 'dist-path' ) ;
4357 const { files } = await buildAndGetResults ( { fixturePath, type : 'dts' } ) ;
@@ -80,41 +94,72 @@ describe('dts when bundle: false', () => {
8094describe ( 'dts when bundle: true' , ( ) => {
8195 test ( 'basic' , async ( ) => {
8296 const fixturePath = join ( __dirname , 'bundle' , 'basic' ) ;
83- const { entryFiles , entries } = await buildAndGetResults ( {
97+ const { files , entries } = await buildAndGetResults ( {
8498 fixturePath,
8599 type : 'dts' ,
86100 } ) ;
87101
88- expect ( entryFiles . esm ) . toMatchInlineSnapshot (
89- `"<ROOT>/tests/integration/dts/bundle/basic/dist/esm/index.d.ts"` ,
102+ expect ( files . esm ) . toMatchInlineSnapshot (
103+ `
104+ [
105+ "<ROOT>/tests/integration/dts/bundle/basic/dist/esm/index.d.ts",
106+ ]
107+ ` ,
90108 ) ;
91109
92- expect ( entryFiles . cjs ) . toMatchInlineSnapshot (
93- `"<ROOT>/tests/integration/dts/bundle/basic/dist/cjs/index.d.ts"` ,
110+ expect ( files . cjs ) . toMatchInlineSnapshot (
111+ `
112+ [
113+ "<ROOT>/tests/integration/dts/bundle/basic/dist/cjs/index.d.ts",
114+ ]
115+ ` ,
94116 ) ;
95117
96118 expect ( entries ) . toMatchSnapshot ( ) ;
97119 } ) ;
98120
99121 test ( 'dts false' , async ( ) => {
100122 const fixturePath = join ( __dirname , 'bundle' , 'false' ) ;
101- const { entryFiles } = await buildAndGetResults ( {
123+ const { files } = await buildAndGetResults ( {
124+ fixturePath,
125+ type : 'dts' ,
126+ } ) ;
127+
128+ expect ( files . esm ) . toMatchInlineSnapshot ( 'undefined' ) ;
129+ } ) ;
130+
131+ test ( 'dts true' , async ( ) => {
132+ const fixturePath = join ( __dirname , 'bundle' , 'true' ) ;
133+ const { files } = await buildAndGetResults ( {
102134 fixturePath,
103135 type : 'dts' ,
104136 } ) ;
105137
106- expect ( entryFiles . esm ) . toMatchInlineSnapshot ( 'undefined' ) ;
138+ expect ( files . esm ) . toMatchInlineSnapshot (
139+ `
140+ [
141+ "<ROOT>/tests/integration/dts/bundle/true/dist/esm/index.d.ts",
142+ "<ROOT>/tests/integration/dts/bundle/true/dist/esm/sum.d.ts",
143+ "<ROOT>/tests/integration/dts/bundle/true/dist/esm/utils/numbers.d.ts",
144+ "<ROOT>/tests/integration/dts/bundle/true/dist/esm/utils/strings.d.ts",
145+ ]
146+ ` ,
147+ ) ;
107148 } ) ;
108149
109150 test ( 'distPath' , async ( ) => {
110151 const fixturePath = join ( __dirname , 'bundle' , 'dist-path' ) ;
111- const { entryFiles } = await buildAndGetResults ( {
152+ const { files } = await buildAndGetResults ( {
112153 fixturePath,
113154 type : 'dts' ,
114155 } ) ;
115156
116- expect ( entryFiles . esm ) . toMatchInlineSnapshot (
117- `"<ROOT>/tests/integration/dts/bundle/dist-path/dist/custom/index.d.ts"` ,
157+ expect ( files . esm ) . toMatchInlineSnapshot (
158+ `
159+ [
160+ "<ROOT>/tests/integration/dts/bundle/dist-path/dist/custom/index.d.ts",
161+ ]
162+ ` ,
118163 ) ;
119164 } ) ;
120165
@@ -130,37 +175,49 @@ describe('dts when bundle: true', () => {
130175
131176 test ( 'autoExtension: true' , async ( ) => {
132177 const fixturePath = join ( __dirname , 'bundle' , 'auto-extension' ) ;
133- const { entryFiles } = await buildAndGetResults ( {
178+ const { files } = await buildAndGetResults ( {
134179 fixturePath,
135180 type : 'dts' ,
136181 } ) ;
137182
138- expect ( entryFiles . cjs ) . toMatchInlineSnapshot (
139- `"<ROOT>/tests/integration/dts/bundle/auto-extension/dist/cjs/index.d.cts"` ,
183+ expect ( files . cjs ) . toMatchInlineSnapshot (
184+ `
185+ [
186+ "<ROOT>/tests/integration/dts/bundle/auto-extension/dist/cjs/index.d.cts",
187+ ]
188+ ` ,
140189 ) ;
141190 } ) ;
142191
143192 test ( 'bundleName -- set source.entry' , async ( ) => {
144193 const fixturePath = join ( __dirname , 'bundle' , 'bundle-name' ) ;
145- const { entryFiles } = await buildAndGetResults ( {
194+ const { files } = await buildAndGetResults ( {
146195 fixturePath,
147196 type : 'dts' ,
148197 } ) ;
149198
150- expect ( entryFiles . esm ) . toMatchInlineSnapshot (
151- `"<ROOT>/tests/integration/dts/bundle/bundle-name/dist/esm/bundleName.d.ts"` ,
199+ expect ( files . esm ) . toMatchInlineSnapshot (
200+ `
201+ [
202+ "<ROOT>/tests/integration/dts/bundle/bundle-name/dist/esm/bundleName.d.ts",
203+ ]
204+ ` ,
152205 ) ;
153206 } ) ;
154207
155208 test ( 'entry is an absolute path' , async ( ) => {
156209 const fixturePath = join ( __dirname , 'bundle' , 'absolute-entry' ) ;
157- const { entryFiles } = await buildAndGetResults ( {
210+ const { files } = await buildAndGetResults ( {
158211 fixturePath,
159212 type : 'dts' ,
160213 } ) ;
161214
162- expect ( entryFiles . esm ) . toMatchInlineSnapshot (
163- `"<ROOT>/tests/integration/dts/bundle/absolute-entry/dist/esm/index.d.ts"` ,
215+ expect ( files . esm ) . toMatchInlineSnapshot (
216+ `
217+ [
218+ "<ROOT>/tests/integration/dts/bundle/absolute-entry/dist/esm/index.d.ts",
219+ ]
220+ ` ,
164221 ) ;
165222 } ) ;
166223} ) ;
0 commit comments