Skip to content

Commit 4167d53

Browse files
committed
test: Add test case
1 parent f7097d5 commit 4167d53

File tree

5 files changed

+66
-0
lines changed

5 files changed

+66
-0
lines changed

β€Žtest/__snapshots__/index.test.js.snapβ€Ž

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,6 +1280,54 @@ exports[`fixtures build class-properties with microbundle 5`] = `
12801280
"
12811281
`;
12821282
1283+
exports[`fixtures build cli-entry-with-cwd with microbundle 1`] = `
1284+
"Used script: microbundle
1285+
1286+
Directory tree:
1287+
1288+
cli-entry
1289+
dist
1290+
cli-entry.esm.mjs
1291+
cli-entry.esm.mjs.map
1292+
cli-entry.js
1293+
cli-entry.js.map
1294+
cli-entry.umd.js
1295+
cli-entry.umd.js.map
1296+
package.json
1297+
src
1298+
one.js
1299+
two.js
1300+
1301+
1302+
Build \\"cli-entry\\" to dist:
1303+
187 B: cli-entry.js.gz
1304+
138 B: cli-entry.js.br
1305+
188 B: cli-entry.esm.mjs.gz
1306+
139 B: cli-entry.esm.mjs.br
1307+
272 B: cli-entry.umd.js.gz
1308+
202 B: cli-entry.umd.js.br"
1309+
`;
1310+
1311+
exports[`fixtures build cli-entry-with-cwd with microbundle 2`] = `6`;
1312+
1313+
exports[`fixtures build cli-entry-with-cwd with microbundle 3`] = `
1314+
"var r=function(){try{var r=arguments;return Promise.resolve([].slice.call(r).reduce(function(r,e){return r+e},0))}catch(r){return Promise.reject(r)}};export default function(){try{var e=arguments,t=[].slice.call(e);return Promise.resolve(r.apply(void 0,t)).then(function(e){return Promise.resolve(r.apply(void 0,t)).then(function(r){return[e,r]})})}catch(r){return Promise.reject(r)}}
1315+
//# sourceMappingURL=cli-entry.esm.mjs.map
1316+
"
1317+
`;
1318+
1319+
exports[`fixtures build cli-entry-with-cwd with microbundle 4`] = `
1320+
"var r=function(){try{var r=arguments;return Promise.resolve([].slice.call(r).reduce(function(r,e){return r+e},0))}catch(r){return Promise.reject(r)}};module.exports=function(){try{var e=arguments,t=[].slice.call(e);return Promise.resolve(r.apply(void 0,t)).then(function(e){return Promise.resolve(r.apply(void 0,t)).then(function(r){return[e,r]})})}catch(r){return Promise.reject(r)}};
1321+
//# sourceMappingURL=cli-entry.js.map
1322+
"
1323+
`;
1324+
1325+
exports[`fixtures build cli-entry-with-cwd with microbundle 5`] = `
1326+
"!function(e,r){\\"object\\"==typeof exports&&\\"undefined\\"!=typeof module?module.exports=r():\\"function\\"==typeof define&&define.amd?define(r):(e||self).cliEntry=r()}(this,function(){var e=function(){try{var e=arguments;return Promise.resolve([].slice.call(e).reduce(function(e,r){return e+r},0))}catch(e){return Promise.reject(e)}};return function(){try{var r=arguments,n=[].slice.call(r);return Promise.resolve(e.apply(void 0,n)).then(function(r){return Promise.resolve(e.apply(void 0,n)).then(function(e){return[r,e]})})}catch(e){return Promise.reject(e)}}});
1327+
//# sourceMappingURL=cli-entry.umd.js.map
1328+
"
1329+
`;
1330+
12831331
exports[`fixtures build css-modules--false with microbundle 1`] = `
12841332
"Used script: microbundle --no-sourcemap --css-modules false
12851333
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"name": "cli-entry"
3+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { two } from './two';
2+
3+
export default async function (...args) {
4+
return [await two(...args), await two(...args)];
5+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export async function two(...args) {
2+
return args.reduce((total, value) => total + value, 0);
3+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "cli-entry-with-cwd",
3+
"scripts": {
4+
"_build": "../../../dist/cli.js -i src/one.js --cwd ./cli-entry",
5+
"build": "microbundle src/one.js --cwd ./cli-entry"
6+
}
7+
}

0 commit comments

Comments
Β (0)