From e774007d66f3aca187a016a2041cef7827c19673 Mon Sep 17 00:00:00 2001 From: Troy Sandal Date: Thu, 11 Jan 2018 11:06:20 -0800 Subject: [PATCH 1/5] debug serially Debug serially to avoid confusing execution paths in async code, e.g. swapping from one test's execution context to the next. --- docs/recipes/debugging-with-vscode.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/recipes/debugging-with-vscode.md b/docs/recipes/debugging-with-vscode.md index 03d2f9913..c39b22cee 100644 --- a/docs/recipes/debugging-with-vscode.md +++ b/docs/recipes/debugging-with-vscode.md @@ -17,6 +17,7 @@ Add following to the `configurations` object: "name": "Run AVA test", "program": "${workspaceRoot}/node_modules/ava/profile.js", "args": [ + "--serial", "${file}" ] } From 435994ab07432b213e33b52f8be2d352988f1c0b Mon Sep 17 00:00:00 2001 From: Troy Sandal Date: Fri, 12 Jan 2018 07:08:33 -0800 Subject: [PATCH 2/5] Update debugging-with-vscode.md --- docs/recipes/debugging-with-vscode.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/recipes/debugging-with-vscode.md b/docs/recipes/debugging-with-vscode.md index c39b22cee..defde7cf9 100644 --- a/docs/recipes/debugging-with-vscode.md +++ b/docs/recipes/debugging-with-vscode.md @@ -17,7 +17,6 @@ Add following to the `configurations` object: "name": "Run AVA test", "program": "${workspaceRoot}/node_modules/ava/profile.js", "args": [ - "--serial", "${file}" ] } @@ -34,3 +33,21 @@ Save this configuration after you added it. Set breakpoints in the code **or** write `debugger;` at the point where it should stop. Hit the green `Debug` button next to the list of configurations on the top left in the `Debug` view. Once the breakpoint is hit, you can evaluate variables and step through the code. + +## Serial Debugging + +> **Note:** The configuration will run tests concurrently, Ava's default, so breakpoints will not be hit sequentially. To avoid this, optionally add the following to the `configurations` object to run the Ava test serially. + +```json +{ + "type": "node", + "request": "launch", + "name": "Run AVA test serially", + "program": "${workspaceRoot}/node_modules/ava/profile.js", + "args": [ + "--serial", + "${file}" + ] +} +``` + From acce15eb38d1db33f073f07e0e69a5e13adfc152 Mon Sep 17 00:00:00 2001 From: Troy Sandal Date: Fri, 12 Jan 2018 07:09:31 -0800 Subject: [PATCH 3/5] Update debugging-with-vscode.md --- docs/recipes/debugging-with-vscode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/recipes/debugging-with-vscode.md b/docs/recipes/debugging-with-vscode.md index defde7cf9..1def5e37e 100644 --- a/docs/recipes/debugging-with-vscode.md +++ b/docs/recipes/debugging-with-vscode.md @@ -34,7 +34,7 @@ Set breakpoints in the code **or** write `debugger;` at the point where it shoul Hit the green `Debug` button next to the list of configurations on the top left in the `Debug` view. Once the breakpoint is hit, you can evaluate variables and step through the code. -## Serial Debugging +# Serial Debug Setup > **Note:** The configuration will run tests concurrently, Ava's default, so breakpoints will not be hit sequentially. To avoid this, optionally add the following to the `configurations` object to run the Ava test serially. From 629fa09fc25e8ac2977b85f5102e3bf84da9af29 Mon Sep 17 00:00:00 2001 From: Troy Sandal Date: Fri, 12 Jan 2018 07:10:13 -0800 Subject: [PATCH 4/5] Update debugging-with-vscode.md --- docs/recipes/debugging-with-vscode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/recipes/debugging-with-vscode.md b/docs/recipes/debugging-with-vscode.md index 1def5e37e..788d43bfa 100644 --- a/docs/recipes/debugging-with-vscode.md +++ b/docs/recipes/debugging-with-vscode.md @@ -36,7 +36,7 @@ Hit the green `Debug` button next to the list of configurations on the top left # Serial Debug Setup -> **Note:** The configuration will run tests concurrently, Ava's default, so breakpoints will not be hit sequentially. To avoid this, optionally add the following to the `configurations` object to run the Ava test serially. +> **Note:** The configuration above will run tests concurrently, Ava's default, so breakpoints will not be hit sequentially. To avoid this, optionally add the following to the `configurations` object to run the Ava test serially. ```json { From f19fe646c3c5c8fd59320510e3b03df89ef1678d Mon Sep 17 00:00:00 2001 From: Mark Wubben Date: Tue, 16 Jan 2018 16:47:02 +0000 Subject: [PATCH 5/5] Reword serial debugging section --- docs/recipes/debugging-with-vscode.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/recipes/debugging-with-vscode.md b/docs/recipes/debugging-with-vscode.md index 788d43bfa..01bb85204 100644 --- a/docs/recipes/debugging-with-vscode.md +++ b/docs/recipes/debugging-with-vscode.md @@ -34,9 +34,9 @@ Set breakpoints in the code **or** write `debugger;` at the point where it shoul Hit the green `Debug` button next to the list of configurations on the top left in the `Debug` view. Once the breakpoint is hit, you can evaluate variables and step through the code. -# Serial Debug Setup +## Serial debugging -> **Note:** The configuration above will run tests concurrently, Ava's default, so breakpoints will not be hit sequentially. To avoid this, optionally add the following to the `configurations` object to run the Ava test serially. +By default AVA runs tests concurrently. This may complicate debugging. Add a configuration with the `--serial` argument so AVA runs only one test at a time: ```json { @@ -51,3 +51,4 @@ Hit the green `Debug` button next to the list of configurations on the top left } ``` +*Note that, if your tests aren't properly isolated, certain test failures may not appear when running the tests serially.*