Skip to content

Commit

Permalink
fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
craigtaub committed Jan 27, 2017
1 parent b8a6237 commit dc01323
Showing 1 changed file with 34 additions and 36 deletions.
70 changes: 34 additions & 36 deletions test/reporters/doc.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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 = {
Expand All @@ -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);
});
});
});

0 comments on commit dc01323

Please sign in to comment.