gjbt

command
Version: v0.0.0-...-a7167af Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2020 License: MIT Imports: 13 Imported by: 0

README

gjbt

gjbt is a simple (temporary) wrapper for GopherJS to run tests in Chrome as opposed to NodeJS.

go get -u myitcv.io/cmd/gjbt

gjbt is a simple (temporary) wrapper for GopherJS to run tests in Chrome as opposed to NodeJS. It should be considered to be a direct replacement for gopherjs test.

Running your tests in Chrome has a number of benefits:

  • it is almost certainly the VM in which your code will ultimately run
  • you have full access to the DOM

Usage

$ gjbt myitcv.io/gjbt
ok      myitcv.io/gjbt  0.273s
PASS

Requirements

Test Requirements

(For now) A small wrapper is required around TestMain in each package to be tested. It is sufficient to copy init_test.go, modifying the test package name, to your package.

DOM Access

See the tests in myitcv.io/react for examples of DOM access.

TODO

  • Switch from being GopherJS specific to also allowing WASM-based tests. At which point gjbt starts to stand for Go Javascript Browswer Test... Indeed at some point we'll need to consider whether the 'j' has any meaning at all!

Documentation

Overview

gjbt is a simple (temporary) wrapper for GopherJS to run tests in Chrome as opposed to NodeJS.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL