Giter VIP home page Giter VIP logo

gogiven's Issues

Better Given/When/Then formatting

As a developer, I want better formatted Given/When/Then output so that the consumers of my test can understand the test more easily.

Better test fluidity

As a developer, I would prefer not to have to chain the given/when/then functions so that I can space the code out better.

Example:

Given(testing, clockParametersUnder(test)).
			When(func(capturedIO testdata.CapturedIO, givens testdata.InterestingGivens) {
			clock, err = berlinclock.Clock(test.time)
		}).
			Then(func(testingT base.TestingT, actual testdata.CapturedIO, givens testdata.InterestingGivens) {
			then.AssertThat(testing, err, is.Nil())
			then.AssertThat(testing, clock, is.
				EqualTo(test.expected).
				Reasonf("time incorrect for %s", test.time))
		})

should be more like this:

func TestMyTest(testing *testing.T) {
    Given(testing, clockParametersUnder(test))

    When(func(capturedIO testdata.CapturedIO, givens testdata.InterestingGivens) {
			clock, err = berlinclock.Clock(test.time)
		})

    Then(func(testingT base.TestingT, actual testdata.CapturedIO, givens testdata.InterestingGivens) {
			then.AssertThat(testing, err, is.Nil())
			then.AssertThat(testing, clock, is.
				EqualTo(test.expected).
				Reasonf("time incorrect for %s", test.time))
    })
}

CSS stylesheet update

Expected Behavior

Output should look and feel like godoc.

Actual Behavior

Looks old and in need of updating.

Steps to Reproduce the Problem

  1. This is an enhancement.

Specifications

  • Go Version: n/a
  • Platform: n/a

Create index file of generated output.

As a user, I want to be able to view an index of test data generated by the framework, so that I can find a test easily.

I especially want to be able to easily navigate to failed tests, and want them indexed in a way that preserves information about the package the test was in.

Given/When/Then inlined variables

As a developer, I want to be able to inline variables I pass to my functions in a formatted way, so that my tests are more understandable.

Example:

func TestMyStuff(testing testing.T){
    Given(iAmMaking_CupsOf_Tea(3, "Earl Grey")).
         When(iPour_MillilitersOfWater("250")).
         Then(func(...){
         // some assertions
         }

}

.. should render as:

Given I am making 3 cups of Earl Grey Tea
When I pour 250 milliliters of water
Then
    // some assertions 

Listener hook

As a developer, I want to be able to get information from my currently running test state, so that I have up to the minute information about the build.

Implementation detail: the test should be able to report to some channel or feed the current state of the test.

Render test comments in GivenWhenThen output

Expected Behavior

...
//This comment should appear as notes next to the test output.
func TestMyTest(t *testing.T){
    Given(someFoo).
     When(somethingHappens).
     Then(...){
     //assertions go here
     }
}

should display as:

Specification
This comment should appear as notes next to the test output
        Given some foo
        When something happens
        Then
        noting that assertions go here

Actual Behavior

The test comment is not rendered.

Steps to Reproduce the Problem

  1. This is an enhancement.

Specifications

  • Go Version:
  • Platform:

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.