Skip to content

hyperstripe50/gopher-jasmine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gopher-jasmine

A runtime-available jasmine inspired acceptance test framework for golang.

Quick Start

Create A Suite and Serve

The following example creates a suite called parent suite which has one test should run one top level test and one child suite first child suite. The child suite has one test should run one child test. The structure is more easily represented in the following way.

  • parent suite
    • should run one top level test
    • first child suite
      • should run one child test

This suite is served at localhost:9091.

package main

import (
  "github.com/hyperstripe50/gopher-jasmine/suite"
  "github.com/hyperstripe50/gopher-jasmine/api"
)

func main() {
  s := suite.NewSequentialSuite("parent suite").
          It("should run one top level test", func(instance map[string]interface{}) error {
            return nil
          }).
          Describe(suite.NewSequentialSuite("first child suite").
                  It("should run one child test", func(instance map[string]interface{}) error {
                    return nil
                  }),
          )
  api.NewApi([]suite.Suite{s}).ListenAndServe(":9091")
}

Run the Suite

All available API endpoints are listed at localhost:9091.

To trigger the parent suite navigate to localhost:9091/parent-suite.