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 the live clock cog

Verifying the functionality for the live clock cog for the user's local time, consists of creating a new time instance, of the current time formatted based on the local zone name and the local timezone offset, and comparing it to the value that is in the myLiveClock div container displayed on the home page.

Here is the test suite for the live clock cog, which is implemented in the liveclockcog_test.go source file found in the client/tests/go directory:

package mainimport (  "time"  "github.com/EngineerKamesh/igb/igweb/client/tests/go/caspertest"  "github.com/gopherjs/gopherjs/js")var wait = js.MakeFunc(func(this *js.Object, arguments []*js.Object) interface{} {  this.Call("waitForSelector", "#myLiveClock div") return ...

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