rtfeldman / rtfeldman/node-test-runner

Can't have describe with same value as module name

Open
#501 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
140
Forks
83
Avg merge
8h 25m
Merged PRs (30d)
5

Description

If you have a test module called Foo you can't use Foo as the string argument to describe. And, if you do, you get a misleading error message: "The test 'Foo' contains a child test of the same name. Let's rename them so we know which is which"

Sample code:

module Foo exposing (..)

import Expect exposing (Expectation)
import Test exposing (..)

suite : Test
suite =
    describe "Foo"
        [ test "t1" (\_ -> 1 + 1 |> Expect.equal 2)
        ]

This is also discussed in #493.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the provided Elm module and describe example, then read the discussion in #493 for related context. Trace the validation that produces the duplicate-child-name error; done means a module and describe value may share the same name without the misleading error, while genuine duplicate child names remain distinguishable.

Written by the indexing model from the issue text.

Assessment

Tech stack
elm, node.js
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.