Giter VIP home page Giter VIP logo

suite's Introduction

Suite

Simple and lightweight test suite for Go.

Features

  1. Support test group.
  2. Setup and TearDown hooks for each suite and test case.
  3. Use the SUITE_RUN environment variable to run the specified test.

Quick Start

package suite_test

import (
	"testing"

	"github.com/ibllex/suite"
)

// UserTest is a valid test suite.
// You don’t need to implement all the suite hooks.
// This example is just for completeness.
// So, just implement what you need.
type UserTest struct{}

// SetupSuite will run once before all test cases are run
func (s *UserTest) SetupSuite(t *testing.T) {
	//
}

// TearDownSuite will run once after all test cases are run
func (s *UserTest) TearDownSuite(t *testing.T) {
	//
}

// SetupTest will run before each test case is run
func (s *UserTest) SetupTest(t *testing.T) {
	//
}

// TearDownTest will run after each test case is run
func (s *UserTest) TearDownTest(t *testing.T) {
	//
}

// Every test case function in a suite should start with `Test` prefix
func (s *UserTest) TestCreateUser(t *testing.T) {
	//
}

func (s *UserTest) TestDeleteUser(t *testing.T) {
	//
}

func (s *UserTest) TestUpdateUser(t *testing.T) {
	//
}

// TestUser run the suite
func TestUser(t *testing.T) {
	suite.Run(t, &UserTest{})
}

License

This library is under the MIT license.

suite's People

Contributors

ibllex avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.