aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureHeader.h
diff options
context:
space:
mode:
authorGravatar Dylan Conway <35280289+dylan-conway@users.noreply.github.com> 2023-03-14 16:50:59 -0700
committerGravatar GitHub <noreply@github.com> 2023-03-14 16:50:59 -0700
commit4792abdb7fbceef7e4ec6bf15c671b88f41c65eb (patch)
tree00db7585ea137a1bbb775cfe586e32078b77b13b /src/bun.js/bindings/ZigGeneratedClasses+lazyStructureHeader.h
parent76b875e4140b45dd7d70e11dfb3a87d2d9469aa0 (diff)
downloadbun-4792abdb7fbceef7e4ec6bf15c671b88f41c65eb.tar.gz
bun-4792abdb7fbceef7e4ec6bf15c671b88f41c65eb.tar.zst
bun-4792abdb7fbceef7e4ec6bf15c671b88f41c65eb.zip
Implement `toMatchSnapshot()` (#2294)
* 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
Diffstat (limited to 'src/bun.js/bindings/ZigGeneratedClasses+lazyStructureHeader.h')
-rw-r--r--src/bun.js/bindings/ZigGeneratedClasses+lazyStructureHeader.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureHeader.h b/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureHeader.h
index ab75a9949..ae3e4233a 100644
--- a/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureHeader.h
+++ b/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureHeader.h
@@ -22,6 +22,12 @@ JSC::Structure* JSExpectStructure() { return m_JSExpect.getInitializedOnMainThre
JSC::LazyClassStructure m_JSExpect;
bool hasJSExpectSetterValue { false };
mutable JSC::WriteBarrier<JSC::Unknown> m_JSExpectSetterValue;
+JSC::Structure* JSExpectAnyStructure() { return m_JSExpectAny.getInitializedOnMainThread(this); }
+ JSC::JSObject* JSExpectAnyConstructor() { return m_JSExpectAny.constructorInitializedOnMainThread(this); }
+ JSC::JSValue JSExpectAnyPrototype() { return m_JSExpectAny.prototypeInitializedOnMainThread(this); }
+ JSC::LazyClassStructure m_JSExpectAny;
+ bool hasJSExpectAnySetterValue { false };
+ mutable JSC::WriteBarrier<JSC::Unknown> m_JSExpectAnySetterValue;
JSC::Structure* JSFileSystemRouterStructure() { return m_JSFileSystemRouter.getInitializedOnMainThread(this); }
JSC::JSObject* JSFileSystemRouterConstructor() { return m_JSFileSystemRouter.constructorInitializedOnMainThread(this); }
JSC::JSValue JSFileSystemRouterPrototype() { return m_JSFileSystemRouter.prototypeInitializedOnMainThread(this); }