@@ -2,12 +2,40 @@ import { join } from 'node:path';
22import { buildAndGetResults } from '@e2e/helper' ;
33import { expect , test } from 'vitest' ;
44
5- test ( 'bundle: false ' , async ( ) => {
5+ test ( 'basic ' , async ( ) => {
66 const fixturePath = join ( __dirname , 'basic' ) ;
77 const { files } = await buildAndGetResults ( fixturePath ) ;
88
9- // TODO: record file paths with inline snapshot
10- // need to add path serialization
11- expect ( files . esm ?. length ) . toBe ( 4 ) ;
12- expect ( files . cjs ?. length ) . toBe ( 4 ) ;
9+ expect ( files . esm ) . toMatchInlineSnapshot ( `
10+ [
11+ "./dist/esm/index.js",
12+ "./dist/esm/sum.js",
13+ "./dist/esm/utils/numbers.js",
14+ "./dist/esm/utils/strings.js",
15+ ]
16+ ` ) ;
17+ expect ( files . cjs ) . toMatchInlineSnapshot ( `
18+ [
19+ "./dist/cjs/index.js",
20+ "./dist/cjs/sum.js",
21+ "./dist/cjs/utils/numbers.js",
22+ "./dist/cjs/utils/strings.js",
23+ ]
24+ ` ) ;
25+ } ) ;
26+
27+ test ( 'single file' , async ( ) => {
28+ const fixturePath = join ( __dirname , 'single-file' ) ;
29+ const { files } = await buildAndGetResults ( fixturePath ) ;
30+
31+ expect ( files . esm ) . toMatchInlineSnapshot ( `
32+ [
33+ "./dist/esm/index.js",
34+ ]
35+ ` ) ;
36+ expect ( files . cjs ) . toMatchInlineSnapshot ( `
37+ [
38+ "./dist/cjs/index.js",
39+ ]
40+ ` ) ;
1341} ) ;
0 commit comments