aboutsummaryrefslogtreecommitdiff
path: root/test/cli (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-07-04[install] fix run-time module loading (#3510)Gravatar Alex Lam S.L 1-16/+92
- fix version buffer confusion - improve workaround to handle cached modules fixes #3507
2023-07-02fix zero length env var (#3496)Gravatar dave caruso 1-0/+10
2023-06-30[install] handle `workspace:` specifier correctly (#3474)Gravatar Alex Lam S.L 2-8/+52
fixes #3430
2023-06-28[install] workaround run-time module loading issue (#3432)Gravatar Alex Lam S.L 2-79/+97
2023-06-26[bun install] Implement `--exact` flag (#3409)Gravatar Jarred Sumner 1-0/+55
* [bun install] Implement `--exact` flag * Rename to --save-exact * Rename --exact to --save-exact * Update bun-add.test.ts * We're going with --exact as the flag name --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-26[install] support trustedDependencies (#3288)Gravatar Alex Lam S.L 1-1/+73
* [install] support trustedDependencies closes #2073 * use `strings.indexOfChar()` * use hashes instead of strings * utilise `inline else`
2023-06-25Add support for install with --frozen-lockfile (#3365)Gravatar Tiago Teixeira 1-0/+49
* Add support for install with --frozen-lockfile * Add test * Add test for frozenLockfile in config file
2023-06-26[install] fix hang in `bun install --production` (#3406)Gravatar Alex Lam S.L 1-10/+39
2023-06-25Add `process.mainModule`Gravatar Jarred Sumner 1-0/+5
2023-06-24Rewrite Bun's runtime CommonJS loader (#3379)Gravatar Jarred Sumner 2-0/+10
* wip changes for CommonJS * this rewrite is almost complete * even more code * wip * Remove usages of `import.meta.require` from builtins * Remove usages of require * Regenerate * :scissors: builtin rewrite commonjs in printer * Use lazy custom getters for import.meta * fixups * Remove depd * ugh * still crashing * fixup undici * comment out import.meta.require.resolve temporarily not a real solution but it stops the crashes * Redo import.meta.primordials * Builtins now have a `builtin://` protocol in source origin * Seems to work? * Finsih getting rid of primordials * switcharoo * No more function * just one more bug * Update launch.json * Implement `require.main` * :scissors: * Bump WebKit * Fixup import cycles * Fixup improt cycles * export more things * Implement `createCommonJSModule` builtin * More exports * regenerate * i broke some stuff * some of these tests work now * We lost the encoding * Sort of fix zlib * Sort of fix util * Update events.js * bump * bump * bump * Fix missing export in fs * fix some bugs with builtin esm modules (stream, worker_threads, events). its not perfect yet. * fix some other internal module bugs * oops * fix some extra require default stuff * uncomment this file but it crsahes on my machine * tidy code here * fixup tls exports * make simdutf happier * Add hasPrefix binding * Add test for `require.main` * Fix CommonJS evaluation order race condition * Make node:http load faster * Add missing exports to tls.js * Use the getter * Regenerate builtins * Fix assertion failure in Bun.write() * revamp dotEnv parser (#3347) - fixes `strings.indexOfAny()` - fixes OOB array access fixes #411 fixes #2823 fixes #3042 * fix tests for `expect()` (#3384) - extend test job time-out for `darwin-aarch64` * `expect().resolves` and `expect().rejects` (#3318) * Move expect and snapshots to their own files * expect().resolves and expect().rejects * Fix promise being added to unhandled rejection list * Handle timeouts in expect(<promise>) * wip merge * Fix merge issue --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> * fixup min/memcopy (#3388) * Fix crash in builtins * Don't attempt to evaluate modules with no source code * Update WebCoreJSBuiltins.cpp * Update WebCoreJSBuiltins.cpp * Update WebCoreJSBuiltins.cpp * Fix crash * cleanup * Fix test cc @paperdave * Fixup Undici * Fix issue in node:http * Create util-deprecate.mjs * Fix several bugs * Use the identifier * Support error.code in `util.deprecate` * make the CJs loader slightly more resilient * Update WebCoreJSBuiltins.cpp * Fix macros --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: dave caruso <me@paperdave.net> Co-authored-by: Alex Lam S.L <alexlamsl@gmail.com> Co-authored-by: Ashcon Partovi <ashcon@partovi.net> Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2023-06-22`expect().resolves` and `expect().rejects` (#3318)Gravatar Ashcon Partovi 1-1/+21
* Move expect and snapshots to their own files * expect().resolves and expect().rejects * Fix promise being added to unhandled rejection list * Handle timeouts in expect(<promise>) * wip merge * Fix merge issue --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-22revamp dotEnv parser (#3347)Gravatar Alex Lam S.L 2-12/+86
- fixes `strings.indexOfAny()` - fixes OOB array access fixes #411 fixes #2823 fixes #3042
2023-06-20Fix crash with .env files that are exactly 159 bytes long (#3369)Gravatar Jarred Sumner 1-0/+23
* Fix crash with .env files that are exactly 158 bytes and a newline character * Update env_loader.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-19Fix bug that breaks `bunx prisma init` when node is not installed (#3362)Gravatar Jarred Sumner 2-0/+21
* tweak cjs * Handle more cases, add a test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-13workaround quote escape issues for `bun run` (#3290)Gravatar Alex Lam S.L 1-0/+15
fixes #53
2023-06-11add --save argument to install (#3277)Gravatar Keyhan Vakil 1-0/+45
2023-06-10[install] fix life cycle scripts execution (#3235)Gravatar Alex Lam S.L 2-14/+102
[install] fix life cycle scripts execution - scripts from dependencies did not run during re-installation - `bun.lockb` now contains data on life cycle scripts - handle prior lockfile format by reading missing info from every `package.json` - suppress spurious log output from tests
2023-06-09Fix to retain a newline after removing a package (#3231)Gravatar ytakhs 1-0/+288
2023-06-02Support `NO_COLOR` environment variable (#3055)Gravatar Ashcon Partovi 1-0/+35
2023-06-01Fix github annotation when using inspect() (#3166)Gravatar Ashcon Partovi 1-1/+17
2023-06-01Implement `__dirname` and `__filename`, allow direct eval in CommonJS (#3164)Gravatar Jarred Sumner 2-1/+15
* Implement `__dirname` and `__filename`, allow direct eval in CommonJS * Fixup dirname and add test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-01mark currently known test fails as `.todo` (#3052)Gravatar dave caruso 3-51/+26
* start this * commit * mark all failing tests as todo * fasdfad * bundler tests * tests * adjust failing tests to todo * comment out some more tests * png as test
2023-05-31Small improvements to `bun test` (#3071)Gravatar Ashcon Partovi 1-12/+370
* Change status icon for skipped tests from "-" to "»" * Show file path instead of filename in `bun test` * Emit collapsable logs when running `bun test` in Github Actions https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines * Add fallback for test icons when emojis are not available * Only check for GITHUB_ACTIONS when running `bun test` * Emit error annotations when running `bun test` in Github Actions https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message * Remove ANSI output from Github annotation, it doesn't work * Remove outdated code from internal test runner * Add GithubActionFormatter to handle cases where error name or message is already ANSI * Fix formatting of test * Fix #3070 * Implement `bun test --run-todo` By default, `test.todo()` is no longer run, unless `--run-todo` is specified. * Fix test that relies on test.todo() being run * Support vitest-style test options * Disable GITHUB_ACTION in test harness * Add types for TestOptions * Fix bug where test.skip() actually ran * Implement `test.skipIf()` and `describe.skipIf()` * Implement `test.runIf()` * Move DiffFormatter to its own file * Fix bug where Bun.inspect() would emit a Github annotation * Introduce `bun test --only`, rename `--run-todo` to `--todo` * Implement `test.if()`, `describe.if()`, and other test fixes * Remove unwanted files from last commit * Fix last reference to --run-todo * Fix memory issues with printing github actions text * Update bindings.zig * Fix bug with `test.only()` * Remove debug test * Make the github annotations better * Improve .vscode/launch.json * Implement `expect().toBeNil()` * Remove .only() from test * Implement toBeBoolean(), toBeTrue(), toBeFalse() * Add lots of matchers * toBeNil() * toBeBoolean() * toBeTrue() * toBeFalse() * toBeNumber() * toBeInteger() * toBeFinite() * toBePositive() * toBeNegative() * toBeWithin() * toBeSymbol() * toBeFunction() * toBeDate() * toBeString() * toInclude() * toStartWith() * toEndWith() * Fix #3135 * Reduce verbosity of test * Fix snapshot bug --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-29Cleanup CommonJS changes (#3112)bun-v0.6.5Gravatar Jarred Sumner 1-0/+9
* Add more GC in test * Fix handling of functions and re-assignments in CommonJS * Increase timeout --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-28[node:net] fix createConnection options passing (#3101)Gravatar Ciro Spaciari 1-2/+2
* fixup createConnection * fix comment * fixup comment * also fix it on tls
2023-05-27Implement process.env.npm_lifecycle_event (#3097)Gravatar Tiramify (A.K. Daniel) 2-43/+17
* Update run_command.zig * Update env.test.ts * Add files via upload * Update run-process-env.test.ts * Update env.test.ts * Update harness.ts
2023-05-25[install] fix `.bin` linking (#3067)Gravatar Alex Lam S.L 2-3/+158
- causes intermittent `bun install` failures on `bun-types`
2023-05-24Load `.env.test`, set NODE_ENV=test in `bun test`, load ↵Gravatar Jarred Sumner 1-0/+256
`.env.{test,production,development}.local` (#3037) * Support `.env.test` & `.env.{test,production,development}.local` * Fix bug preventing inlining of process.env.NODE_ENV by default * Update env_loader.zig * add env tests --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: dave caruso <me@paperdave.net>
2023-05-24Implement `require.cache` (#3045)Gravatar Jarred Sumner 3-0/+39
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-24extend test time-outs (#3048)Gravatar Alex Lam S.L 2-7/+7
- avoid intermittent failures due to network latencies
2023-05-23Implement `bun test --timeout` (#3040)Gravatar Ashcon Partovi 1-0/+66
You can change the default per-test timeout in `bun test`: > bun test --timeout 10 The default timeout is 5000.
2023-05-16Update run-cjs.test.tsGravatar Jarred Sumner 1-1/+0
2023-05-16Fix running commonjs modules as entry point (#2885)Gravatar dave caruso 1-0/+60
* fix cjs run issue * use a primordial * fix behavior * fix it again * fix tste
2023-05-10`bun add` from root folder when call within workspaces (#2841)Gravatar Alex Lam S.L 2-7/+65
- ignore invalid `package.json` from parent directories - `echo` new lines from `make` targets correctly
2023-05-10[install] operator on root package of workspaces (#2834)Gravatar Alex Lam S.L 2-0/+224
- parse `bunfig.toml` from same directory as `package.json` - handle `--cwd` correctly fixes #2592
2023-05-01[install] handle `devDependencies` of local folders (#2781)Gravatar Alex Lam S.L 1-0/+106
fixes #2653
2023-04-30[install] handle repeated install of GitHub dependency correctly (#2780)Gravatar Alex Lam S.L 1-93/+402
fixes #2602
2023-04-24[install] fix `bun add` on non-aliased dependency (#2728)Gravatar Alex Lam S.L 1-0/+64
2023-04-06bun-types: infer strict `Subprocess` from `Bun.spawn()` options, part 2 (#2573)Gravatar dave caruso 1-6/+6
2023-04-03Use absolute paths morebun-v0.5.9Gravatar Jarred Sumner 2-6/+11
2023-04-03Fix test failureGravatar Jarred Sumner 1-15/+18
2023-03-30[install] fix stale pointer with tarball URLs (#2520)Gravatar Alex Lam S.L 1-0/+80
* [install] fix stale pointer with tarball URLs fixes #2512 * `alloc()` & `free()` instead of fixed-size buffer
2023-03-30[install] fix re-install of git dependency (#2519)Gravatar Alex Lam S.L 1-0/+464
- add tests for re-install of npm alias & GitHub URL
2023-03-29[install] fix re-run of tarball URL from lockfile (#2507)Gravatar Alex Lam S.L 2-2/+295
2023-03-28[install] support tarball URLs (#2497)Gravatar Alex Lam S.L 1-0/+190
closes #2448
2023-03-25[install] fix tests (#2488)Gravatar Alex Lam S.L 3-23/+33
- avoid creating spurious directories next to test scripts
2023-03-23Fixes #2462 (#2463)Gravatar Jarred Sumner 1-0/+58
2023-03-22Fix types (#2453)Gravatar Colin McDonnell 6-17/+30
* WIP * WIP * WIP * WIP * Improve typechecking in type files * Fix typechecking * Update * Update submodule * CI for typechecking * Add ci * Update commands * Format after build * Dont use bunx * Rename job * Use nodemodules prettier * Update workflow * Use symlink * Debug * Debug * Clean up and rename jobs
2023-03-20Implement simple `workspaces` glob support in bun install (#2435)Gravatar Jarred Sumner 3-9/+56
* [bun install] Implement `packages/*`-style globs * Fix incorrect assertion * :nail_care: * remove extraneous console.log * Fix pointer to stack memory * Add a test with a scoped package name from a glob workspace * Fixup --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-03-19Several bug fixes (#2427)Gravatar Jarred Sumner 1-3/+38
* Fix test * Fix segfault when unexpected type is passed in `expect().toThrow` * Fix issues with request constructor * Don't bother cloning headers when its empty * woops * more tests * fix incorrect test * Make the fetch error messages better * Update response.zig * Fix test that failed on macOS * Fix test * Remove extra hash table lookups * Support running dummy registry directly cc @alexlamsl * Update test * Update test * fixup * Workaround crash in test runner * Fixup test * Fixup test * Update os.test.js --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>