Organizing and namespacing tests.
See original GitHub issueIt’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:
- Created 6 years ago
- Comments:8 (8 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve been wrapping my tests in functions, something like here: https://github.com/flowtype/flow-typed/blob/master/definitions/npm/angular_v1.5.x/flow_v0.47.x-/test_angular_scope_v1.5.x.js
Well, I fixed the library so now we can use
describe
andit
blocks as first-class functions, just like in an ordinary testing environment. #1928 for more info. Here’s to better testing! 🥂