MCPcopy Index your code
hub / github.com/pocketbase/pocketbase / TestBindCoreContext

Function TestBindCoreContext

plugins/jsvm/binds_test.go:184–206  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

182}
183
184func TestBindCoreContext(t *testing.T) {
185 vm := goja.New()
186 BindCore(vm)
187
188 _, err := vm.RunString(`
189 const base = new Context(null, "a", 123);
190 const sub = new Context(base, "b", 456);
191
192 const scenarios = [
193 {key: "a", expected: 123},
194 {key: "b", expected: 456},
195 ];
196
197 for (let s of scenarios) {
198 if (sub.value(s.key) != s.expected) {
199 throw new("Expected " +s.key + " value " + s.expected + ", got " + sub.value(s.key));
200 }
201 }
202 `)
203 if err != nil {
204 t.Fatal(err)
205 }
206}
207
208func TestBindCoreCookie(t *testing.T) {
209 vm := goja.New()

Callers

nothing calls this directly

Calls 1

BindCoreFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…