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 time ago cog

Testing the time ago cog consists of establishing a gopher's known date of joining the IGWEB team. We will establish May 24, 2017, as Molly's start date, and use this as the basis to test the human understandable time that is displayed under Molly's bio data on the About page.

Here is the test suite for the time ago cog, which is implemented in the humantimecog_test.go source file found in the client/tests/go directory:

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

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