aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/test (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-03-28More bug fixes (#2486)Gravatar Jarred Sumner 1-2/+10
* readline_promises test fix * fix `escapeHTML` for baseline builds * fs test fixes, use `tmpdir()` * add paths for `resolve.test.js` * isError with toString symbol and error prototype * comment about `toString` * skip async macro transform * test cleanup, skip stack format test * readline undo and redo fix * capture error from readline keypress * Update tcp-server.test.ts * use `removefileat` for recursive rmdir * use strong for `signal.reason` * initialize `m_flags` * directory with file fs test * recursive option * import expect * could be less than * move abort signal tests to another process * fix typecheck --------- Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2023-03-19Prevent undefined memory accessGravatar Jarred Sumner 1-1/+1
2023-03-19Several bug fixes (#2427)Gravatar Jarred Sumner 1-119/+59
* 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>
2023-03-17Feat(test): add toMatch (#2404)Gravatar zhiyuan 1-6/+71
2023-03-15feat(expect): update toBeInstanceOf (#2396)Gravatar zhiyuan 1-12/+15
* feat: update instanceof binding * fix: according to PR comments
2023-03-14Implement `toMatchSnapshot()` (#2294)Gravatar Dylan Conway 3-11/+2623
* buggy snapshot * error output for failed snapshot * missing first * hints * open dir once, better cleanup * update flag * truncate on update * object and class snapshot formatting * array formatting * no function name, single item is empty array * string objects, maps, sets, promise * avoid using invalid memory * handle number objects * handle extending `Number` * boolean objects * snapshot tests and test updates * snapshot format for buffers * safer snapshot parsing * property matchers setup * strings and tests * generate classes with empty prototype * optional `propertyMatchers` parameter * new test folder structure * strings.eqlLong * globalObject.throwPretty() and expect.any tests * add updateSnapshot flag to help * move snapshot format out of `printErrorlikeObject` * empty object snapshot format * separate typed array, remove trailing comma * use `isCell`, object trailing commas * handle unicode * todo for primitive constructors * switch to `JSC.Node.Syscall.open` and `JSC.Maybe` * use js parser for snapshot files * deinit ast, log parse error * copy/paste most of `exports.ZigConsoleClient` * remove snapshot option * remove ordered properties option * remove snapshot format option from `exports.zig` * remove extra newlines * change mode * update test runner output * escape backticks faster * `bunx jest` in temp dir * remove buffered writer * add `toMatchSnapshot` to types * cleanup, switch to `pread` * cli `--update` flag * `--update-snapshots` * remove string object format
2023-03-14feat: add toBeInstanceOf matcher in expect (#2389)Gravatar zhiyuan 1-1/+64
2023-03-06support `expect().toThrow(/pattern/)` (#2314)Gravatar Alex Lam S.L 1-3/+74
- fix time-zone-dependent test failure
2023-02-24wiptest -> testGravatar Dylan Conway 1-1/+1
2023-02-23Upgrade Zig (#2151)Gravatar Dylan Conway 1-10/+10
* fixup * Upgrade Zig * Remove bad assertion * strings * bump * mode -> optimize * optimize * Linux build * Update bindgen.zig
2023-02-22fix string diff extra newlineGravatar Dylan Conway 1-1/+1
2023-02-22newlines for array diffGravatar Dylan Conway 1-16/+12
2023-02-22format options with quote strings (#2134)Gravatar Dylan Conway 1-33/+39
2023-02-22wiptest -> test (#2131)Gravatar Dylan Conway 1-25/+87
* +/- for object diff, quote more strings * wiptest -> test * quote strings fix
2023-02-21Update test runner output with colors and diffs (#2122)Gravatar Dylan Conway 1-125/+854
* add zig-diff * move diff functions * toHaveProperty diff for objects * use formatter * format labels * move work to format, diff when it makes sense * remove comptime, dim equal slices * order before diff * line diffs * add diffz * switch to diffz * add `diffLines()` function * small `prettyFmt()` bug fix * test runner color output * update `toBe()` error output * fix test * diff method, fix crash * fix link test * remove `isRegex`
2023-02-06Mark some things as not configurableGravatar Jarred Sumner 1-0/+1
2023-01-22[EventEmitter] Preserve `this` in event emitter callbacksGravatar Jarred Sumner 1-4/+40
2023-01-13Split some things into more files and use bun namespace instead of import moreGravatar Jarred SUmner 1-1/+1
2023-01-12pointer typeGravatar Dylan Conway 1-1/+1
2023-01-12more carefulGravatar Jarred Sumner 1-2/+2
2023-01-12[bun:test] Support `async` in `expect(async () => { await 1; }).toThrow()`Gravatar Jarred Sumner 1-5/+40
2023-01-12fix(bun-test): test title in results (#1753)Gravatar Ethan Burrell 1-1/+1
* fix(bun-test): test title in results * missed case * clean up import * respond to reviews
2023-01-10Fix flipped orderGravatar Jarred Sumner 1-3/+5
2023-01-09[bun:test] Implement `test.skip`Gravatar Jarred Sumner 1-36/+92
2023-01-09Fixes https://github.com/oven-sh/bun/issues/1533Gravatar Jarred Sumner 1-5/+5
2023-01-09Make autotick logic more consistentGravatar Jarred Sumner 1-5/+1
2023-01-09Cleanup code in expectToThrowGravatar Jarred Sumner 1-12/+15
2023-01-08[internal] Fix checking for Error objectGravatar Jarred Sumner 1-10/+10
2023-01-05[socket] fix double-free in `finalize()` (#1731)Gravatar Alex Lam S.L 1-36/+33
- tidy up `.isEmptyOrUndefinedOrNull()` usage
2023-01-05improve `.toThrow()` compatibility with Jest (#1728)Gravatar Alex Lam S.L 1-16/+32
2023-01-04implement `expect().toThrow()` (#1727)Gravatar Alex Lam S.L 1-9/+73
- fix bugs in `JSBufferList` - add tests
2023-01-02implement `net.Socket` (#1701)Gravatar Alex Lam S.L 1-3/+9
- support TCP sockets for now, i.e. no IPC - extra features like keep-alive, no-delay etc. are absent due to limitations of uSockets - fix `jest` to treat `done(nullish)` as success
2023-01-01clean up `Promise` handling (#1697)Gravatar Alex Lam S.L 1-18/+19
2023-01-01Handle extremely unlikely edgecaseGravatar Jarred SUmner 1-10/+21
2022-12-31[jest] fix and improve hooks (#1689)Gravatar Alex Lam S.L 1-3/+49
- wait for async hooks to complete before running tests - add support for `done(err)` callbacks in hooks fixes #1688
2022-12-28Upgrade to latest Zig (#1610)Gravatar Jarred Sumner 1-17/+17
* @min and @max * builtins and some trivial ones * Most of them * more * more! * More Progress * wip * Update tagged_pointer.zig * Update http_client_async.zig * Most of the iterable dir changes * alright * Remove usages of deprecated formatters * :camera: * fmt * Update shimmer.zig * wip * wip * wip * progress * more * Latest * stuck on error * latest * workaround stage2 * wip * Update string_immutable.zig * wip * Migrate `Dirent` and `require("fs')` to use JSC<>Zig bindings * Fix build errors * Fixup most of the test failures * Fix `make headers` * Fix "outside package path" error * Fixup aligned alloc * Add missing file * linux * More linux fixes * use latest peechy * Fix transpiler test failure * Forgot about these * Fixup test failure * Update node-timers.test.ts * [node:htt] Fix `undefined is not an object` error Fixes https://github.com/oven-sh/bun/issues/1618 * Update http.exports.js * Make this test less flaky * fix hashes * Fix hex formatting and zls issues * Download zig version * Update Dockerfile * Update Dockerfile * Update uws * Update Dockerfile * Set llvm version * Update README.md * Update uws * Update Dockerfile * Update io_linux.zig * Update bun.zig * Log output * workaround strange @cInclude error * Make ffi tests better * Don't use cImport * Update c.zig * Update c-bindings.cpp * call setOutputDir * Update Dockerfile * Use a longer name * latest * Update serve.test.ts Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-12-21fix jest hooks in bun-test (#1639)Gravatar Ethan Burrell 1-2/+3
* fix(jest) fix broken jest hooks * add tests
2022-12-04[bun:test] Fix crash when `test("foo")` is called without passing a functionGravatar Jarred Sumner 1-6/+13
2022-12-02matchers for less than and greater than (#1573)Gravatar Dylan Conway 1-4/+252
* toBeGreaterThan with tests * toBeGreaterThanOrEqual and tests * toBeLessThan and toBeLessThanOrEqual with tests * expect types * switch expressions
2022-12-01bun test `toStrictEqual` (#1568)Gravatar Dylan Conway 1-1/+42
* toStrictEqual and bug fix in deepEqual * rebase Remove some dead bindings code * remove debugging test * canGetIndexQuickly for array holes * isStrict template Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-11-29import everything from "bun" where possibleGravatar Jarred Sumner 1-10/+10
2022-11-28toHaveProperty and tests (#1558)Gravatar Dylan Conway 2-2/+72
* toHaveProperty and tests * emoji tests
2022-11-23Bun.deepEquals and expect().toEqual() (#1548)Gravatar Dylan Conway 1-1/+40
* all of deepEquals * remove comment, tests, move inline function
2022-11-20Update jest.zigGravatar Jarred Sumner 1-1/+1
2022-11-20[bun:test] Fix bug with returning a non-promise object in a `test` or `it` ↵Gravatar Jarred Sumner 1-25/+27
function
2022-11-19Introduce `BUN_GARBAGE_COLLECTOR_LEVEL` debug environment variableGravatar Jarred Sumner 1-1/+26
2022-11-18bun test matchers and tests (#1526)Gravatar Dylan Conway 2-50/+361
* ignore webkit for cherry-pick * toContain and toBeTruthy * toBe null, undefined, falsy, toHaveProperty, .not * markBindings * remove toHaveProperty, undo ignore webkit, more tests * undo ignore webkit * remove bad tests * check if length property exists for toHaveLength() * fix call signature * handle argument that is not an integer * getLengthOfArray returns u64 * switch to truncate * toHaveLength() edge cases * add toBooleanSlow() * infinity, nan, negative
2022-11-15add generated getter/setter type with thisValue (#1513)Gravatar Dylan Conway 2-1/+4
2022-11-07[bun:test] Rejected promises should cause tests to failGravatar Jarred Sumner 1-0/+9
2022-11-07[bun:test] Implement `done` callback with support for async functionsGravatar Jarred Sumner 1-11/+126