CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/golang-github-com-onsi-ginkgo-v2

A mature testing framework for Go designed to help you write expressive specs

Overall
score

97%

Overview
Eval results
Files

task.mdevals/scenario-2/

Test Suite with Flexible Setup Timing

Build a test suite for a user session management system that requires precise control over setup execution order.

Context

You need to test a system that manages user sessions. The system has a configuration layer and a session layer. Tests need to:

  1. Configure the system with different parameters in outer test contexts
  2. Initialize sessions based on those configurations
  3. Verify session behavior matches the configuration

The key requirement is that session initialization must happen after all configuration is set up, but before each individual test runs.

Requirements

Create a test suite in session_test.go that:

  1. Uses nested test contexts to organize tests by configuration scenarios
  2. Sets up base configuration in outer contexts
  3. Initializes sessions based on the final configuration (after all setup layers complete)
  4. Cleans up sessions after each test, but before outer cleanup runs
  5. Includes at least 3 test cases across 2 different configuration contexts

The test suite should demonstrate that:

  • Configuration changes in different contexts affect session initialization correctly
  • Session initialization happens at the right time (after all configuration, before tests)
  • Cleanup happens in the correct order

@generates

Test Cases

  • Authenticated user session has correct permissions @test
  • Guest user session has limited access @test
  • Session timeout value matches configuration @test

Dependencies { .dependencies }

github.com/onsi/ginkgo/v2 { .dependency }

BDD testing framework for Go that provides test organization and lifecycle hooks.

github.com/onsi/gomega { .dependency }

Matcher library for assertions in Go tests.

Install with Tessl CLI

npx tessl i tessl/golang-github-com-onsi-ginkgo-v2

tile.json