Skip to content
This repository has been archived by the owner on Dec 27, 2018. It is now read-only.

1.3 reporter #14

Merged
merged 6 commits into from Mar 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions meteor/src/client/HtmlReporter.coffee
Expand Up @@ -26,6 +26,7 @@ class practical.mocha.HtmlReporter extends practical.mocha.BaseReporter
try
log.enter("addReporterHtml")
div = document.createElement('div')
div.className = 'mocha-wrapper'

div.innerHTML = '<div class="content">
<div class="test-wrapper">
Expand All @@ -46,7 +47,3 @@ class practical.mocha.HtmlReporter extends practical.mocha.BaseReporter
document.body.appendChild(div)
finally
log.return()


Meteor.startup ->
MochaRunner.setReporter(practical.mocha.HtmlReporter)
6 changes: 6 additions & 0 deletions mocha.css
@@ -1,3 +1,7 @@
.xxxReporterCss { color: white; }

@charset "utf-8";

body {
margin:0;
}
Expand Down Expand Up @@ -278,3 +282,5 @@ body {
margin-left: 50px;
margin-bottom: -25px;
}

.xxxReporterCss { color: white; }
13 changes: 11 additions & 2 deletions package.js
Expand Up @@ -3,13 +3,20 @@ Package.describe({
name: "practicalmeteor:mocha",
summary: "Write package tests with mocha and run them in the browser or from the command line with spacejam.",
git: "https://github.com/practicalmeteor/meteor-mocha.git",
version: '2.1.0_7'
version: '2.1.0_7',
testOnly: true
});


Npm.depends({
mocha: "2.1.0"
});


Package.onUse(function (api) {
api.versionsFrom('1.0');
api.versionsFrom("1.3-beta.12");

api.use('tmeasday:test-reporter-helpers@0.2.0');
api.use('coffeescript');
api.use('underscore');
api.use('session');
Expand All @@ -18,6 +25,7 @@ Package.onUse(function (api) {
api.use('random');
api.use('mongo');
api.use('autoupdate');
api.use('ecmascript');

// If we use a reactive reporter such as meteor's test-in-browser one,
// we'll need all of this.
Expand Down Expand Up @@ -72,6 +80,7 @@ Package.onUse(function (api) {
api.addFiles(['meteor/src/lib/MochaRunner.coffee']);
api.addFiles('meteor/src/client/HtmlReporter.coffee', 'client');

api.mainModule('runTests.js');
});


Expand Down
7 changes: 7 additions & 0 deletions runTests.js
@@ -0,0 +1,7 @@
import { hideOtherCSS, hideApp } from 'meteor/tmeasday:test-reporter-helpers';

export const runTests = () => {
hideApp('.mocha-wrapper');
hideOtherCSS();
MochaRunner.setReporter(practical.mocha.HtmlReporter)
}