MCPcopy Create free account
hub / github.com/Snapchat/Valdi / getJsModulePropertyWithSchema

Function getJsModulePropertyWithSchema

valdi/test/integration/Runtime_tests.cpp:186–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184 JSBridgeTestFixture::SetUp();
185 if (IsSkipped()) {
186 return;
187 }
188 auto* jsBridge = getJsBridge();
189 wrapper = RuntimeWrapper(jsBridge, getTSNMode());
190 }
191
192 void TearDown() override {
193 wrapper.teardown();
194 }
195
196 TSNMode getTSNMode() const {
197 return isWithTSN() ? TSNMode::Enabled : TSNMode::Disabled;
198 }
199
200 RuntimeWrapper wrapper;
201};
202
203static Result<Value> getJsModuleWithSchema(
204 Runtime* runtime,
205 const std::shared_ptr<snap::valdi_core::JSRuntimeNativeObjectsManager>& nativeObjectsManager,
206 ValueSchemaRegistry* registry,
207 std::string_view moduleName,
208 const ValueSchema& schema) {
209 auto resolvedSchema = schema;
210 if (registry != nullptr) {
211 ValueSchemaTypeResolver typeResolver(registry);
212 auto schemaResult = typeResolver.resolveTypeReferences(schema);

Callers 3

TEST_PFunction · 0.85
TEST_PMethod · 0.85

Calls 8

getGlobalFunction · 0.85
getJsModuleWithSchemaFunction · 0.85
makeStringMethod · 0.80
valueMethod · 0.65
parseFunction · 0.50
ClassPropertySchemaClass · 0.50
getPropertyMethod · 0.45
getTypedObjectMethod · 0.45

Tested by

no test coverage detected