(t *testing.T)
| 182 | } |
| 183 | |
| 184 | func 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 | |
| 208 | func TestBindCoreCookie(t *testing.T) { |
| 209 | vm := goja.New() |
nothing calls this directly
no test coverage detected
searching dependent graphs…