Skip to content

Commit

Permalink
[Fix] code coverage problem with nested groups
Browse files Browse the repository at this point in the history
  • Loading branch information
jtenner committed Aug 22, 2019
1 parent ad2b09e commit 12c47ca
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 8 deletions.
1 change: 1 addition & 0 deletions packages/assembly/assembly/__tests__/unmanaged.spec.wat
Expand Up @@ -3294,6 +3294,7 @@
i32.const 0
i32.const 0
call $~lib/rt/tlsf/__alloc
call $~lib/rt/pure/__retain
local.set $0
end
local.get $0
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/lib/as-pect.cli.amd.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/cli/lib/util/CommandLineArg.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/core/lib/as-pect.core.amd.d.ts.map

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion packages/core/lib/as-pect.core.amd.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion packages/core/lib/test/TestCollector.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion packages/core/lib/test/TestContext.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions packages/core/src/test/TestCollector.ts
Expand Up @@ -612,8 +612,10 @@ export class TestCollector {
*/
private reportTest(testNamePointer: number, callback: number): void {
const group = this.groupStack[this.groupStack.length - 1];
/* istanbul ignore next */
if (!group.willRun) return;
const name = this.getString(testNamePointer, "No test() name provided.");
/* istanbul ignore next */
if (!this.testRegex.test(name)) return;

const test = new TestResult();
Expand Down Expand Up @@ -668,8 +670,10 @@ export class TestCollector {
message: number,
): void {
const group = this.groupStack[this.groupStack.length - 1];
/* istanbul ignore next */
if (!group.willRun) return;
const name = this.getString(testNamePointer, "No test() name provided.");
/* istanbul ignore next */
if (!this.testRegex.test(name)) return;

const test = new TestResult();
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/test/TestContext.ts
Expand Up @@ -89,7 +89,9 @@ export class TestContext extends TestCollector {

private runGroup(group: TestGroup): void {
if (!group.willRun) {
/* istanbul ignore next */
for (const child of group.children) {
/* istanbul ignore next */
this.runGroup(child);
/* istanbul ignore next */
if (this.endGroup) return;
Expand Down

0 comments on commit 12c47ca

Please sign in to comment.