beartest-js 6.0.1 → 6.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/beartest.js +5 -3
  2. package/package.json +1 -1
package/beartest.js CHANGED
@@ -38,7 +38,7 @@ async function runSuite(suite) {
38
38
  }
39
39
 
40
40
  function makeSuite(headline, only = false, fn = null) {
41
- const parent = top();
41
+ const parent = fn ? topSafe() : top();
42
42
  const self = {
43
43
  depth: parent ? parent.depth + 1 : 0,
44
44
  headline,
@@ -69,8 +69,10 @@ function makeSuite(headline, only = false, fn = null) {
69
69
  if (fn) fn();
70
70
  if (fn) suiteStack.pop();
71
71
  if (self.depth === 0) {
72
- const timeoutPromise = new Promise((resolve) => setTimeout(resolve, 0));
73
- testRunPromise = timeoutPromise.then(() => runSuite(self));
72
+ testRunPromise = new Promise((resolve) => setTimeout(resolve, 0)).then(() => {
73
+ suiteStack.pop();
74
+ return runSuite(self);
75
+ });
74
76
  }
75
77
  return self;
76
78
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beartest-js",
3
- "version": "6.0.1",
3
+ "version": "6.0.3",
4
4
  "description": "Bear Bones Testing",
5
5
  "repository": {
6
6
  "type": "git",