We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In jest the execution is like the following:
Order of execution of describe and test blocks Jest executes all describe handlers in a test file before it executes any of the actual tests. This is another reason to do setup and teardown inside before* and after* handlers rather than inside the describe blocks. Once the describe blocks are complete, by default Jest runs all the tests serially in the order they were encountered in the collection phase, waiting for each to finish and be tidied up before moving on. Consider the following illustrative test file and output: describe('outer', () => { console.log('describe outer-a'); describe('describe inner 1', () => { console.log('describe inner 1'); test('test 1', () => { console.log('test for describe inner 1'); expect(true).toEqual(true); }); }); console.log('describe outer-b'); test('test 1', () => { console.log('test for describe outer'); expect(true).toEqual(true); }); describe('describe inner 2', () => { console.log('describe inner 2'); test('test for describe inner 2', () => { console.log('test for describe inner 2'); expect(false).toEqual(false); }); }); console.log('describe outer-c'); }); // describe outer-a // describe inner 1 // describe outer-b // describe inner 2 // describe outer-c // test for describe inner 1 // test for describe outer // test for describe inner 2
In Tasty this behaviour is currently different:
Describe("Scopes", () => { BeforeEach(() => Console.WriteLine("Before Scope")); AfterEach(() => Console.WriteLine("After Scope")); Describe("Nested #1", () => { BeforeEach(() => Console.WriteLine("Before Nested #1")); AfterEach(() => Console.WriteLine("After Nested #1")); It("test #1", () => Console.WriteLine("test #1")); }); Describe("Nested #2", () => { BeforeEach(() => Console.WriteLine("Before Nested #2")); AfterEach(() => Console.WriteLine("After Nested #2")); It("test #1", () => Console.WriteLine("test #2")); }); });
Before Nested #1 test #1 After Nested #1 👍 [00:00:00.0077] Scopes Nested #1 test #1 Before Nested #2 test #2 After Nested #2 👍 [00:00:00.0008] Scopes Nested #2 test #1 ============================================================================================================================================================= Summary: F0 | I0 | NR0 | S2 | T2 Time: [00:00:00.0000] | [00:00:00.0000] | [00:00:00.0000] | [00:00:00.0085] | [00:00:00.0085] Outcome: Success =================================================================================================
which is plain wrong
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In jest the execution is like the following:
In Tasty this behaviour is currently different:
which is plain wrong
The text was updated successfully, but these errors were encountered: