mocha-parallel-tests
mocha-parallel-tests copied to clipboard
Verification null value missing
Not sure what is the root reason for the issue. Possibly file with ignored tests on describe level (investigating now). Need to be fixed. It fail entire run....
Unhandled asynchronous exception: TypeError: Cannot set property 'toString' of null
at Array.subprocessParseReviver (/usr/src/app/node_modules/mocha-parallel-tests/dist/main/util.js:18:26)
at Array.
Yes, the reason was - I had files with x on describe level
@qatechniker well if this is working okay with mocha and fails with mocha-parallel-tests, this can be an issue. Thanks for posting this, I will investigate this case a bit further.
Hey @qatechniker do you still have this issue when using xdescribes and mocha-parallel-tests?
Hey, I think it can not disappear if nobody fixed ))) I just removed this situation in my set up.
Need to create PR to this project with test to proof...
That would be great! Right now we have a test for these methods: https://github.com/mocha-parallel/mocha-parallel-tests/tree/master/test/skip-test, so I was almost sure that mocha-parallel-tests supports xdescribe
as well.
I apologize if this is off-base, but I have an error that presents as the same error.
Environment:
- Node: v8.14.0
- Npm: 6.4.1
- mocha-parallel-tests: 2.0.6-alpha.3
- mocha: 5.2.0
The situation is when a before all
block fails for a skipped describe
block. When this happens the error comes out as:
$ $(npm bin)/mocha-parallel-tests test/skipped.js
Unhandled asynchronous exception: TypeError: Cannot set property 'toString' of null
at Array.subprocessParseReviver (/Users/isaac/code/experiments/parallel/node_modules/mocha-parallel-tests/dist/main/util.js:18:26)
at Array.<anonymous> (/Users/isaac/code/experiments/parallel/node_modules/circular-json/build/circular-json.node.js:138:30)
at JSON.parse (<anonymous>)
at Object.parse (/Users/isaac/code/experiments/parallel/node_modules/circular-json/build/circular-json.node.js:196:32)
at MochaWrapper.addSubprocessSuites (/Users/isaac/code/experiments/parallel/node_modules/mocha-parallel-tests/dist/main/mocha.js:99:59)
at TaskManager.taskManager.on (/Users/isaac/code/experiments/parallel/node_modules/mocha-parallel-tests/dist/main/mocha.js:73:22)
at emitOne (events.js:116:13)
at TaskManager.emit (events.js:211:7)
at TaskManager.onTaskProcessingFinished (/Users/isaac/code/experiments/parallel/node_modules/mocha-parallel-tests/dist/main/task-manager.js:19:18)
at emitTwo (events.js:126:13)
While mocha reports correctly:
$ $(npm bin)/mocha test/skipped.js
describe block
1) "before all" hook
0 passing (9ms)
1 failing
1) describe block
"before all" hook:
AssertionError [ERR_ASSERTION]: false == true
+ expected - actual
-false
+true
at Context.before (test/skipped.js:5:5)
The minimal example to trigger this error is:
const assert = require('assert');
describe('describe block', function () {
before(function () {
assert(false);
});
describe.skip('skipped describe block', function () {
it('should never get here', function () {
assert(false);
});
});
});
I'm not familiar enough with mocha-parallel-tests
to discern what might be the root of the problem. It seems that when the before all
hook fails, the subprocessParseReviver
gets called with the skipped test
, which has a fn
property that is null
. This overwrites the fn
on the test, and then fails. If I go into src/main/util.ts and add delete value.fn
in the case of a test, the correct result happens:
$ $(npm bin)/mocha-parallel-tests test/skipped.js
describe block
1) "before all" hook
0 passing (249ms)
1 failing
1)
describe block
"before all" hook:
AssertionError [ERR_ASSERTION]: false == true
at Context.<anonymous> (test/skipped.js:5:5)
This could just be covering over the root cause, though.
any updates on this issue?
Unhandled asynchronous exception: TypeError: Cannot set property 'toString' of null
at Array.subprocessParseReviver (/usr/lib/node_modules/mocha-parallel-tests/dist/main/util.js:18:26)
at Array.
We just have a little gulp task to fix the issue in our build pipeline. Not the greatest solution, but until something is addressed here, one that works.
I apologize if this is off-base, but I have an error that presents as the same error.
Environment:
- Node: v8.14.0
- Npm: 6.4.1
- mocha-parallel-tests: 2.0.6-alpha.3
- mocha: 5.2.0
The situation is when a
before all
block fails for a skippeddescribe
block. When this happens the error comes out as:$ $(npm bin)/mocha-parallel-tests test/skipped.js Unhandled asynchronous exception: TypeError: Cannot set property 'toString' of null at Array.subprocessParseReviver (/Users/isaac/code/experiments/parallel/node_modules/mocha-parallel-tests/dist/main/util.js:18:26) at Array.<anonymous> (/Users/isaac/code/experiments/parallel/node_modules/circular-json/build/circular-json.node.js:138:30) at JSON.parse (<anonymous>) at Object.parse (/Users/isaac/code/experiments/parallel/node_modules/circular-json/build/circular-json.node.js:196:32) at MochaWrapper.addSubprocessSuites (/Users/isaac/code/experiments/parallel/node_modules/mocha-parallel-tests/dist/main/mocha.js:99:59) at TaskManager.taskManager.on (/Users/isaac/code/experiments/parallel/node_modules/mocha-parallel-tests/dist/main/mocha.js:73:22) at emitOne (events.js:116:13) at TaskManager.emit (events.js:211:7) at TaskManager.onTaskProcessingFinished (/Users/isaac/code/experiments/parallel/node_modules/mocha-parallel-tests/dist/main/task-manager.js:19:18) at emitTwo (events.js:126:13)
While mocha reports correctly:
$ $(npm bin)/mocha test/skipped.js describe block 1) "before all" hook 0 passing (9ms) 1 failing 1) describe block "before all" hook: AssertionError [ERR_ASSERTION]: false == true + expected - actual -false +true at Context.before (test/skipped.js:5:5)
The minimal example to trigger this error is:
const assert = require('assert'); describe('describe block', function () { before(function () { assert(false); }); describe.skip('skipped describe block', function () { it('should never get here', function () { assert(false); }); }); });
I'm not familiar enough with
mocha-parallel-tests
to discern what might be the root of the problem. It seems that when thebefore all
hook fails, thesubprocessParseReviver
gets called with the skippedtest
, which has afn
property that isnull
. This overwrites thefn
on the test, and then fails. If I go into src/main/util.ts and adddelete value.fn
in the case of a test, the correct result happens:$ $(npm bin)/mocha-parallel-tests test/skipped.js describe block 1) "before all" hook 0 passing (249ms) 1 failing 1) describe block "before all" hook: AssertionError [ERR_ASSERTION]: false == true at Context.<anonymous> (test/skipped.js:5:5)
This could just be covering over the root cause, though.
Have exactly the same issue.