mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 19:08:50 +00:00
* stfdsafsd sadffdsa stuff finish commonjs stuff asdf not done but work not done but work not done yet but this is how far i am remove files lol update built files uncomment everything in events lol export default stuff * afdsafsd * its not perfect but almost done * okay * cool * remove temp file * finish rebase * revert settings.json * a * ch-ch-ch-ch-changes * okay * remove this check in release for now * sxdcfghnjm, * lkjhgf * fmt * filename can be null * Update NodeModuleModule.h * weee * fmt --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
18 lines
622 B
TypeScript
18 lines
622 B
TypeScript
import { expect, test } from "bun:test";
|
|
import { mkdirSync, realpathSync } from "fs";
|
|
import { bunEnv, bunExe } from "harness";
|
|
import { tmpdir } from "os";
|
|
import { join } from "path";
|
|
|
|
test.todo("running a commonjs module works", async () => {
|
|
const dir = join(realpathSync(tmpdir()), "bun-run-test1");
|
|
mkdirSync(dir, { recursive: true });
|
|
await Bun.write(join(dir, "index1.js"), "module.exports = 1; console.log('hello world');");
|
|
let { stdout } = Bun.spawnSync({
|
|
cmd: [bunExe(), join(dir, "index1.js")],
|
|
cwd: dir,
|
|
env: bunEnv,
|
|
});
|
|
expect(stdout.toString("utf8")).toEqual("hello world\n");
|
|
});
|