mtest

package
v0.0.0-...-b7787a3 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2016 License: Apache-2.0, MIT Imports: 3 Imported by: 0

Documentation

Overview

Package mtest implements functions for testing mithril components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MithrilTest

type MithrilTest struct {
	T         *testing.T
	Component interface{}
	Output    *Output
}

MithrilTest provides helper functions for testing gopherjs-based mithril applications

func New

func New(t *testing.T, comp interface{}) *MithrilTest

New starts a new mithril test using the provided mithril component.

type Output

type Output struct {
	*js.Object
}

func Query

func Query(compOrView interface{}) *Output

Query invokes mithril-query on the provided component or view

func (*Output) Contains

func (o *Output) Contains(str string) bool

func (*Output) Find

func (o *Output) Find(sel string) *js.Object

func (*Output) First

func (o *Output) First(sel string) *js.Object

func (*Output) Has

func (o *Output) Has(sel string) bool

Has returns true if any element in tree matches the selector, otherwise false

Jump to

Keyboard shortcuts

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