Here's an example of how to debug Mocha v4 if it hangs.
Ensure you're using a Node.js 8 or newer (or any version with async_hooks support).
If you run your test, you'll notice it hangs:
$ mocha test.js
Here's an example of how to debug Mocha v4 if it hangs.
Ensure you're using a Node.js 8 or newer (or any version with async_hooks support).
If you run your test, you'll notice it hangs:
$ mocha test.js
Say we have a JS library, and that library exports an API.
For the sake of argument, that library could be mocha and the API could be the "BDD" interface:
describe('my suite', function () {
it('should timeout in 10s', function (done) {
this.timeout(10);
setTimeout(done, 9000);
});| <templateSet group="Mocha"> | |
| <template name="desc" value="describe('$DESC$', function() { $END$ });" description="makes a describe block" toReformat="true" toShortenFQNames="true"> | |
| <variable name="DESC" expression="jsMethodName()" defaultValue="" alwaysStopAt="true" /> | |
| <context> | |
| <option name="JAVA_SCRIPT" value="true" /> | |
| </context> | |
| </template> | |
| <template name="be" value="beforeEach(function() { $END$ });" description="beforeEach" toReformat="true" toShortenFQNames="true"> | |
| <context> | |
| <option name="JAVA_SCRIPT" value="true" /> |
| /** | |
| * @see https://stackoverflow.com/questions/15975440/add-ellipses-to-overflowing-text-in-svg | |
| * @example | |
| * <!-- truncate at 200px --> | |
| * <svg><svg:text ellipsis [text]="text to truncate" [width]="200"></svg:text></svg> | |
| */ | |
| import { | |
| Directive, | |
| ElementRef, |
| license: mit |
| license: mit |
| license: mit |
| --- | |
| # This task just includes everything else we need | |
| - include_role: | |
| # a task to install nodejs from Nodesource's distros | |
| name: nodejs | |
| - include_role: | |
| # a task to install nginx | |
| name: web | |
| # everything below here is in this gist | |
| - include: prerequisites.yml |
| { | |
| "presets": [ | |
| [ | |
| "env", | |
| { | |
| "targets": { | |
| "node": 4 | |
| } | |
| } | |
| ] |
I hereby claim:
To claim this, I am signing this object: