question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Organizing and namespacing tests.

See original GitHub issue

It’s been a long-time beef of mine that tests are written as giant, single files with all constants globally namespaced and no descriptors for tests generally. What do people think of adopting a convention in lieu of a proper TDD framework to better organize tests? Something like…

// #add
{
  // it should accept numbers
  {
    const a: number = add(1 + 1)
  }
  
  // it should error when we pass null
  {
    // $ExpectError
    const a: number = add(1 + null)
  }
}

And so on. Thoughts? If we did adopt any convention, it’d be important that it could be incrementally adopted.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
villesaucommented, Feb 14, 2018
0reactions
AndrewSouthpawcommented, Mar 9, 2018

Well, I fixed the library so now we can use describe and it blocks as first-class functions, just like in an ordinary testing environment. #1928 for more info. Here’s to better testing! 🥂

Read more comments on GitHub >

github_iconTop Results From Across the Web

Organizing PHPUnit Tests in Namespaces - Stack Overflow
Approach 1: Place each TestCase class into the same namespace as the covered class. \SomeFramework\Utilities\AwesomeClassTest. Advantages.
Read more >
Organizing Your Tests - Telerik
Test Studio enables you to create nested folders to help you organize your tests. With some careful planning you can create an information ......
Read more >
PHPUnit file structure, namespace, and required metadata
Tests of core classes are placed in the following directory and their namespace will consist of the path minus the configured folder. Note...
Read more >
5. Organizing Tests — PHPUnit 9.5 Manual - Read the Docs
PHPUnit supports different ways of organizing tests and composing them into a test suite. This chapter shows the most commonly used approaches. Composing...
Read more >
Organizing and testing projects with the .NET CLI - .NET
This tutorial explains how to organize and test .NET projects from the command line.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found