-
Notifications
You must be signed in to change notification settings - Fork 3
MVP/pre-release #1
base: master
Are you sure you want to change the base?
Conversation
src/stats-collector.ts
Outdated
'use strict'; | ||
/** | ||
(The MIT License) | ||
Copyright (c) 2011-2018 JS Foundation and contributors, https://js.foundation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix copyright header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, this file was copied from mocha
source and then edited to include typings. The createStatsCollector
function isn't exported by the published npm
package, so I had to copy it. I put a comment below the license header... maybe I should have put it above the license header?
**
* The following was extracted from
* https://github.com/mochajs/mocha/blob/master/lib/stats-collector.js
*/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I can skip the function and just make these properties part of the runner. That'd be cleaner. Will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for delay. A few initial questions, I'll take a closer look at the code next round.
@@ -0,0 +1,39 @@ | |||
# mocha-suite-child | |||
|
|||
Intended for use when running mocha in web-browsers, runs mocha test suites defined in HTML documents and include the results as if they are part of the main context. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and includes
// Defines the children of the current mocha context. Note that | ||
// the same test suite files can be reused as children, with different | ||
// configurations. These must be defined at the top-level, i.e. | ||
// they can't be nested within Mocha's own `suite()` declarations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add something here about how it creates an iframe
for each suiteChild
?
container = document.createElement('div'); | ||
container.id = this.containerId; | ||
container.style.position = 'absolute'; | ||
container.style.top = '-9999px'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean the iframe is not visible? If not, isn't it better for it to be visible so that you can see what it's doing, and because that could maybe affect throttling/in-view behaviors (e.g. requestAnimationFrame
can be disabled for windows that are not in view).
… reporting issue with multiple browsers that seems only remedied when actual top-level suite present. Investigating.
This package provides a
window.suiteChild
method and patchesmocha.run
to enable running external HTML resources with their own mocha test suites and aggregating the results in the local mocha runner event-stream.This was written when switching https://github.com/Polymer/lit-element test runner from web-component-tester to karma and identified that we needed a way to run the test suite with multiple permutations of polyfills in multiple window contexts without running multiple invocations of karma, which would massively balloon the runtime of the test suite.
The README does a basic job of showing usage as does everything in
./test/