aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h
diff options
context:
space:
mode:
authorGravatar Dylan Conway <35280289+dylan-conway@users.noreply.github.com> 2023-06-09 19:26:36 -0700
committerGravatar GitHub <noreply@github.com> 2023-06-09 19:26:36 -0700
commit76cf465cc2e87c400b6bea56cad1f17f94b91da2 (patch)
treed72518cf461407fb3c0b88d8e108057f57c8b5b6 /src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h
parent0f018ea2159f7bad499d8a2f50837a4d888b2344 (diff)
downloadbun-76cf465cc2e87c400b6bea56cad1f17f94b91da2.tar.gz
bun-76cf465cc2e87c400b6bea56cad1f17f94b91da2.tar.zst
bun-76cf465cc2e87c400b6bea56cad1f17f94b91da2.zip
`toMatchObject` and some asymmetric matchers (#3260)
* `toMatchObject` progress * add `expect.stringContaining()` * add `expect.stringMatching()` * print asymmetric matchers * cleanup * return before printing if constructor value isn't there * move matcher logic to cpp * pretty format and tests * fix formatting for snapshots * format `stringContaining` and `stringMatching` like jest * better test * remove commented tests * remove old property matcher code * add types * make sure all props are matched in arrays * add `Bun.deepMatch`
Diffstat (limited to 'src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h')
-rw-r--r--src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h b/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h
index 8756ed660..4e5a2c1fa 100644
--- a/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h
+++ b/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h
@@ -41,6 +41,24 @@ void GlobalObject::initGeneratedLazyClasses() {
init.setStructure(WebCore::JSExpectAny::createStructure(init.vm, init.global, init.prototype));
});
+ m_JSExpectAnything.initLater(
+ [](LazyClassStructure::Initializer& init) {
+ init.setPrototype(WebCore::JSExpectAnything::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.global)));
+ init.setStructure(WebCore::JSExpectAnything::createStructure(init.vm, init.global, init.prototype));
+
+ });
+ m_JSExpectStringContaining.initLater(
+ [](LazyClassStructure::Initializer& init) {
+ init.setPrototype(WebCore::JSExpectStringContaining::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.global)));
+ init.setStructure(WebCore::JSExpectStringContaining::createStructure(init.vm, init.global, init.prototype));
+
+ });
+ m_JSExpectStringMatching.initLater(
+ [](LazyClassStructure::Initializer& init) {
+ init.setPrototype(WebCore::JSExpectStringMatching::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.global)));
+ init.setStructure(WebCore::JSExpectStringMatching::createStructure(init.vm, init.global, init.prototype));
+
+ });
m_JSFileSystemRouter.initLater(
[](LazyClassStructure::Initializer& init) {
init.setPrototype(WebCore::JSFileSystemRouter::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.global)));
@@ -190,6 +208,9 @@ void GlobalObject::visitGeneratedLazyClasses(GlobalObject *thisObject, Visitor&
thisObject->m_JSDirent.visit(visitor); visitor.append(thisObject->m_JSDirentSetterValue);
thisObject->m_JSExpect.visit(visitor); visitor.append(thisObject->m_JSExpectSetterValue);
thisObject->m_JSExpectAny.visit(visitor); visitor.append(thisObject->m_JSExpectAnySetterValue);
+ thisObject->m_JSExpectAnything.visit(visitor); visitor.append(thisObject->m_JSExpectAnythingSetterValue);
+ thisObject->m_JSExpectStringContaining.visit(visitor); visitor.append(thisObject->m_JSExpectStringContainingSetterValue);
+ thisObject->m_JSExpectStringMatching.visit(visitor); visitor.append(thisObject->m_JSExpectStringMatchingSetterValue);
thisObject->m_JSFileSystemRouter.visit(visitor); visitor.append(thisObject->m_JSFileSystemRouterSetterValue);
thisObject->m_JSListener.visit(visitor); visitor.append(thisObject->m_JSListenerSetterValue);
thisObject->m_JSMD4.visit(visitor); visitor.append(thisObject->m_JSMD4SetterValue);