qunit

package module
v0.0.0-...-9fa555c Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2019 License: MIT Imports: 1 Imported by: 29

README

#GopherJS Bindings for QUnit

Install

go get github.com/rusco/qunit 
  • QUnit, A Javascript Unit Testing Framework (Qunit)
  • GopherJS, A Golang to Javascript Transpiler (GopherJS)

Attention

This is just a minimal QUnit Binding to test the jQuery Bindings. At some point in time I might move to the native Golang Testing facilities.

Look at the example folder for a sample usage

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsyncTest

func AsyncTest(name string, testFn func() interface{}) *js.Object

func AsyncTestExpected

func AsyncTestExpected(name string, expected interface{}, testFn func() interface{}) *js.Object

func Begin

func Begin(callbackFn func() interface{}) *js.Object

func Done

func Done(callbackFn func(details DoneCallbackObject) interface{}) *js.Object

func Equiv

func Equiv(a interface{}, b interface{}) *js.Object

func Expect

func Expect(amount int) *js.Object

func Log

func Log(callbackFn func(details LogCallbackObject) interface{}) *js.Object

func Module

func Module(name string) *js.Object

func ModuleDone

func ModuleDone(callbackFn func(details ModuleDoneCallbackObject) interface{}) *js.Object

func ModuleLifecycle

func ModuleLifecycle(name string, lc Lifecycle) *js.Object

func ModuleStart

func ModuleStart(callbackFn func(name string) interface{}) *js.Object

func Ok

func Ok(state interface{}, message string) *js.Object

func Push

func Push(result interface{}, actual interface{}, expected interface{}, message string) *js.Object

func Reset

func Reset() *js.Object

func Start

func Start() *js.Object

func StartDecrement

func StartDecrement(decrement int) *js.Object

func Stop

func Stop() *js.Object

func StopIncrement

func StopIncrement(increment int) *js.Object

func Test

func Test(name string, testFn func(QUnitAssert))

start QUnit static methods

func TestDone

func TestDone(callbackFn func(details TestDoneCallbackObject) interface{}) *js.Object

func TestExpected

func TestExpected(title string, expected int, testFn func(assert QUnitAssert) interface{}) *js.Object

func TestStart

func TestStart(callbackFn func(details TestStartCallbackObject) interface{}) *js.Object

Types

type DoneCallbackObject

type DoneCallbackObject struct {
	*js.Object
	Failed  int `js:"failed"`
	Passed  int `js:"passed"`
	Total   int `js:"total"`
	Runtime int `js:"runtime"`
}

type Lifecycle

type Lifecycle interface {
	Setup()
	Teardown()
}

type LogCallbackObject

type LogCallbackObject struct {
	*js.Object
	// contains filtered or unexported fields
}

type ModuleDoneCallbackObject

type ModuleDoneCallbackObject struct {
	*js.Object
	// contains filtered or unexported fields
}

type ModuleStartCallbackObject

type ModuleStartCallbackObject struct {
	*js.Object
	// contains filtered or unexported fields
}

type QUnitAssert

type QUnitAssert struct {
	*js.Object
}

func (QUnitAssert) Async

func (qa QUnitAssert) Async() func()

func (QUnitAssert) DeepEqual

func (qa QUnitAssert) DeepEqual(actual interface{}, expected interface{}, message string) bool

func (QUnitAssert) Equal

func (qa QUnitAssert) Equal(actual interface{}, expected interface{}, message string) bool

func (QUnitAssert) NotDeepEqual

func (qa QUnitAssert) NotDeepEqual(actual interface{}, expected interface{}, message string) bool

func (QUnitAssert) NotEqual

func (qa QUnitAssert) NotEqual(actual interface{}, expected interface{}, message string) bool

func (QUnitAssert) NotPropEqual

func (qa QUnitAssert) NotPropEqual(actual interface{}, expected interface{}, message string) bool

func (QUnitAssert) NotStrictEqual

func (qa QUnitAssert) NotStrictEqual(actual interface{}, expected interface{}, message string) bool

func (QUnitAssert) Ok

func (qa QUnitAssert) Ok(state interface{}, message string) bool

func (QUnitAssert) PropEqual

func (qa QUnitAssert) PropEqual(actual interface{}, expected interface{}, message string) bool

func (QUnitAssert) StrictEqual

func (qa QUnitAssert) StrictEqual(actual interface{}, expected interface{}, message string) bool

func (QUnitAssert) Throws

func (qa QUnitAssert) Throws(block func() interface{}, message string) *js.Object

func (QUnitAssert) ThrowsExpected

func (qa QUnitAssert) ThrowsExpected(block func() interface{}, expected interface{}, message string) *js.Object

type Raises

type Raises struct {
	*js.Object
	Raises *js.Object `js:"raises"`
}

type TestDoneCallbackObject

type TestDoneCallbackObject struct {
	*js.Object
	// contains filtered or unexported fields
}

type TestStartCallbackObject

type TestStartCallbackObject struct {
	*js.Object
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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