Compare commits

...

6 Commits

Author SHA1 Message Date
Don Isaac
a53cd62fab Merge branch 'main' into don/test/new-file-spam 2024-12-19 19:18:36 -08:00
Don Isaac
968cc94439 Merge branch 'main' into don/test/new-file-spam 2024-12-17 00:01:45 -08:00
Don Isaac
fb6bd98b64 add default export to temp js, etc. files 2024-12-09 13:46:33 -08:00
Don Isaac
a0fd291c92 fix source path 2024-12-09 12:15:53 -08:00
Don Isaac
57b8a8dc2a fix entrypoint name 2024-12-09 11:46:06 -08:00
Don Isaac
ae51d4c68b test(bundler): do not create lmao.* files in repo root 2024-12-09 11:44:59 -08:00

View File

@@ -619,22 +619,26 @@ console.log(JSON.stringify(json))
},
{
name: "index.js",
contents: /* ts */ `console.log('HELLO FRIENDS')`,
contents: /* ts */ `console.log('HELLO FRIENDS');
export default {}`,
loader: "js",
},
{
name: "index.ts",
contents: /* ts */ `console.log('HELLO FRIENDS')`,
contents: /* ts */ `console.log('HELLO FRIENDS');
export default {}`,
loader: "ts",
},
{
name: "lmao.jsx",
contents: /* ts */ `console.log('HELLO FRIENDS')`,
contents: /* ts */ `console.log('HELLO FRIENDS');
export default {}`,
loader: "jsx",
},
{
name: "lmao.tsx",
contents: /* ts */ `console.log('HELLO FRIENDS')`,
contents: /* ts */ `console.log('HELLO FRIENDS');
export default {}`,
loader: "tsx",
},
{
@@ -651,14 +655,17 @@ console.log(JSON.stringify(json))
for (const { name, contents, loader } of additional_files) {
it(`works with ${loader} loader`, async () => {
await Bun.$`echo ${contents} > ${name}`;
const dependencyPath = path.join(tempdir, name);
const sourcePath = path.join(tempdir, "index.ts");
await Bun.$`echo ${contents} > ${dependencyPath}`;
const source = /* ts */ `import foo from "./${name}";
console.log(foo);`;
await Bun.$`echo ${source} > index.ts`;
await Bun.$`echo ${source} > ${sourcePath}`;
const result = await Bun.build({
outdir,
entrypoints: [path.join(tempdir, "index.ts")],
entrypoints: [sourcePath],
plugins: [
{
name: "test",
@@ -674,6 +681,7 @@ console.log(JSON.stringify(json))
],
});
if (!result.success) console.log(result);
expect(result.success).toBeTrue();
});
}