O'Reilly logo

Isomorphic Go by Kamesh Balasubramanian

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Verifying client-side routing and template rendering

The CasperJS test that we implemented in Go, to test the client-side routing, can be found in the routes_test.go source file in the client/tests/go directory.

In the import grouping, notice that we include the caspertestjs package, where we defined the ViewportParams struct, and we include the js package:

package mainimport (  "strings"  "github.com/EngineerKamesh/igb/igweb/client/tests/go/caspertest"  "github.com/gopherjs/gopherjs/js")

We will use the functionality found in the js package, quite extensively, to tap into the CasperJS functionality since there are currently no GopherJS bindings available for CasperJS.

We will define a JavaScript function called wait, which is responsible for ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required