Skip to content

Commit

Permalink
Merge branch 'devel' into release-1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Newman committed Aug 23, 2017
2 parents 55be71b + cd54054 commit 754b0c5
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 9 deletions.
6 changes: 5 additions & 1 deletion packages/test-in-browser/driver.css
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,8 @@ body {
#current-client-test {
color: #ccc;
margin-right: 15px;
}
}

.failedTests {
color: #900; /* red */
}
39 changes: 32 additions & 7 deletions packages/test-in-browser/driver.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template name="testInBrowserBody">
<div class="container-fluid">
{{> navBars}}
{{> uncaughtErrors}}
{{> failedTests}}
{{> testTable}}
</div>
Expand Down Expand Up @@ -71,14 +72,38 @@
</div>
</template>

<template name="uncaughtErrors">
{{#if uncaughtErrors}}
<div class="row-fluid">
<div class="span12">
<div class="alert alert-danger">
<p>
<strong>WARNING:</strong> The following uncaught errors might be
preventing some client tests from running.
</p>
<ul>
{{#each uncaughtErrors}}
<li>{{this}}</li>
{{/each}}
</ul>
</div>
</div>
</div>
{{/if}}
</template>

<template name="failedTests">
<div class="row-fluid"><div class="span12">
<ul class="failedTests">
{{#each failedTests}}
<li>{{this}}</li>
{{/each}}
</ul>
</div></div>
{{#if failedTests}}
<div class="row-fluid">
<div class="span12">
<ul class="failedTests">
{{#each failedTests}}
<li>{{this}}</li>
{{/each}}
</ul>
</div>
</div>
{{/if}}
</template>

<template name="testTable">
Expand Down
13 changes: 13 additions & 0 deletions packages/test-in-browser/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ var topLevelGroupsDep = new Tracker.Dependency;
// - dep: Tracker.Dependency object for this test. fires when the test completes.
var resultTree = [];

Session.set("uncaughtErrors", []);
window.onerror = (message, source, line) => {
const uncaughtErrors = new Set(Session.get("uncaughtErrors"));
uncaughtErrors.add(message);
Session.set("uncaughtErrors", Array.from(uncaughtErrors));
};

Session.setDefault("groupPath", ["tinytest"]);
Session.set("rerunScheduled", false);
Expand Down Expand Up @@ -359,6 +365,13 @@ Template.groupNav.onRendered(function () {
};
});

//// Template - uncaughtErrors

Template.uncaughtErrors.helpers({
uncaughtErrors() {
return Session.get("uncaughtErrors");
}
});

//// Template - failedTests

Expand Down
3 changes: 2 additions & 1 deletion packages/test-in-browser/package.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Package.describe({
summary: "Run tests interactively in the browser",
version: '1.0.13',
version: '1.0.14',
documentation: null
});

Package.onUse(function (api) {
api.use('ecmascript');
// XXX this should go away, and there should be a clean interface
// that tinytest and the driver both implement?
api.use('tinytest');
Expand Down
7 changes: 7 additions & 0 deletions tools/cli/help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,10 @@ Options:
test app rebuild.
--extra-packages Run with additional packages (comma separated, for example:
--extra-packages "package-name1, package-name2@1.2.3")
--driver-package Name of the optional test driver package to use to run
tests and display results. For example:
--driver-package practicalmeteor:mocha

>>> test
Test the application
Usage: meteor test --driver-package <driver> [options]
Expand Down Expand Up @@ -638,6 +642,9 @@ Options:
--verbose Print all output from builds logs.
--extra-packages Run with additional packages (comma separated, for example:
--extra-packages "package-name1, package-name2@1.2.3")
--driver-package Name of the optional test driver package to use to run
tests and display results. For example:
--driver-package practicalmeteor:mocha

>>> self-test
Run tests of the 'meteor' tool.
Expand Down

0 comments on commit 754b0c5

Please sign in to comment.