Tests that preloaded JavaScript files have been executed before user is given input.
(t *testing.T)
| 222 | // Tests that preloaded JavaScript files have been executed before user is given |
| 223 | // input. |
| 224 | func TestPreload(t *testing.T) { |
| 225 | tester := newTester(t, nil) |
| 226 | defer tester.Close(t) |
| 227 | |
| 228 | tester.console.Evaluate("preloaded") |
| 229 | if output := tester.output.String(); !strings.Contains(output, "some-preloaded-string") { |
| 230 | t.Fatalf("preloaded variable missing: have %s, want %s", output, "some-preloaded-string") |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | // Tests that the JavaScript objects returned by statement executions are properly |
| 235 | // pretty printed instead of just displaying "[object]". |