mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 12:55:47 +02:00
add tests for my tests
This commit is contained in:
parent
304d74370e
commit
5e475355bf
6 changed files with 119 additions and 3 deletions
|
@ -12,6 +12,10 @@ import (
|
|||
|
||||
// Test describes an integration tests that will be run against the lazygit gui.
|
||||
|
||||
// our unit tests will use this description to avoid a panic caused by attempting
|
||||
// to get the test's name via it's file's path.
|
||||
const unitTestDescription = "test test"
|
||||
|
||||
type IntegrationTest struct {
|
||||
name string
|
||||
description string
|
||||
|
@ -45,8 +49,15 @@ type NewIntegrationTestArgs struct {
|
|||
}
|
||||
|
||||
func NewIntegrationTest(args NewIntegrationTestArgs) *IntegrationTest {
|
||||
name := ""
|
||||
if args.Description != unitTestDescription {
|
||||
// this panics if we're in a unit test for our integration tests,
|
||||
// so we're using "test test" as a sentinel value
|
||||
name = testNameFromFilePath()
|
||||
}
|
||||
|
||||
return &IntegrationTest{
|
||||
name: testNameFromFilePath(),
|
||||
name: name,
|
||||
description: args.Description,
|
||||
extraCmdArgs: args.ExtraCmdArgs,
|
||||
skip: args.Skip,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue