Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

fix linting errors

Craig Taubdc0132390478
diff --git a/test/reporters/doc.spec.js b/test/reporters/doc.spec.js
index febce1ed..f62c8331 100644
--- a/test/reporters/doc.spec.js
+++ b/test/reporters/doc.spec.js
@@ -15,85 +15,83 @@ describe('Doc reporter', function () {
};
});
- describe('on suite', function() {
- describe('if suite root does not exist', function() {
+ describe('on suite', function () {
+ describe('if suite root does not exist', function () {
var expectedTitle = 'expectedTitle';
var suite = {
root: false,
title: expectedTitle
- }
+ };
it('should log html with expected title', function () {
runner.on = function (event, callback) {
if (event === 'suite') {
callback(suite);
}
- }
- var doc = new Doc(runner);
+ };
+ Doc(runner);
process.stdout.write = stdoutWrite;
var expectedArray = [
' <section class="suite">\n',
' <h1>' + expectedTitle + '</h1>\n',
' <dl>\n'
];
- stdout.should.deepEqual(expectedArray)
+ stdout.should.deepEqual(expectedArray);
});
});
- describe('if suite root does exist', function() {
+ describe('if suite root does exist', function () {
var suite = {
root: true
- }
+ };
it('should not log any html', function () {
runner.on = function (event, callback) {
if (event === 'suite') {
callback(suite);
}
- }
- var doc = new Doc(runner);
+ };
+ Doc(runner);
process.stdout.write = stdoutWrite;
stdout.should.be.empty();
});
});
});
- describe('on suite end', function() {
- describe('if suite root does not exist', function() {
- var expectedTitle = 'expectedTitle';
+ describe('on suite end', function () {
+ describe('if suite root does not exist', function () {
var suite = {
- root: false,
- title: expectedTitle
- }
+ root: false
+ };
it('should log expected html', function () {
runner.on = function (event, callback) {
if (event === 'suite end') {
callback(suite);
}
- }
- var doc = new Doc(runner);
+ };
+ Doc(runner);
process.stdout.write = stdoutWrite;
var expectedArray = [
' </dl>\n', '</section>\n'
];
- stdout.should.deepEqual(expectedArray)
+ stdout.should.deepEqual(expectedArray);
});
});
- describe('if suite root does exist', function() {
+ describe('if suite root does exist', function () {
var suite = {
root: true
- }
+ };
it('should not log any html', function () {
runner.on = function (event, callback) {
if (event === 'suite end') {
callback(suite);
}
- }
- var doc = new Doc(runner);
+ };
+ Doc(runner);
process.stdout.write = stdoutWrite;
stdout.should.be.empty();
});
});
});
- describe('on pass', function() {
+ describe('on pass', function () {
var expectedTitle = 'some tite';
var expectedBody = 'some body';
var test = {
@@ -102,24 +100,24 @@ describe('Doc reporter', function () {
slow: function () {
return '';
}
- }
+ };
it('should log html with expected title and body', function () {
runner.on = function (event, callback) {
if (event === 'pass') {
callback(test);
}
- }
- var doc = new Doc(runner);
+ };
+ Doc(runner);
process.stdout.write = stdoutWrite;
var expectedArray = [
' <dt>' + expectedTitle + '</dt>\n',
' <dd><pre><code>' + expectedBody + '</code></pre></dd>\n'
];
- stdout.should.deepEqual(expectedArray)
+ stdout.should.deepEqual(expectedArray);
});
});
- describe('on fail', function() {
+ describe('on fail', function () {
var expectedTitle = 'some tite';
var expectedBody = 'some body';
var test = {
@@ -128,21 +126,21 @@ describe('Doc reporter', function () {
slow: function () {
return '';
}
- }
+ };
it('should log html with expected title and body', function () {
runner.on = function (event, callback) {
if (event === 'fail') {
callback(test);
}
- }
- var doc = new Doc(runner);
+ };
+ Doc(runner);
process.stdout.write = stdoutWrite;
var expectedArray = [
- ' <dt class=\"error\">' + expectedTitle + '</dt>\n',
- ' <dd class=\"error\"><pre><code>' + expectedBody + '</code></pre></dd>\n',
- ' <dd class=\"error\">undefined</dd>\n'
+ ' <dt class="error">' + expectedTitle + '</dt>\n',
+ ' <dd class="error"><pre><code>' + expectedBody + '</code></pre></dd>\n',
+ ' <dd class="error">undefined</dd>\n'
];
- stdout.should.deepEqual(expectedArray)
+ stdout.should.deepEqual(expectedArray);
});
});
});