summaryrefslogtreecommitdiffstats
path: root/test/assertions.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-09-15 14:20:32 +0200
committerSamy Pessé <samypesse@gmail.com>2015-09-15 14:20:32 +0200
commit1fd00068595dfced5a0f16ac05ae2553d09608bc (patch)
tree1605473bf22c7e4ab90a6cc9bebf5cb807fa1d90 /test/assertions.js
parent5a205346e3d125b1c834220ce98a206d88697811 (diff)
downloadgitbook-1fd00068595dfced5a0f16ac05ae2553d09608bc.zip
gitbook-1fd00068595dfced5a0f16ac05ae2553d09608bc.tar.gz
gitbook-1fd00068595dfced5a0f16ac05ae2553d09608bc.tar.bz2
Lint all tests
Diffstat (limited to 'test/assertions.js')
-rw-r--r--test/assertions.js32
1 files changed, 16 insertions, 16 deletions
diff --git a/test/assertions.js b/test/assertions.js
index f81645b..7e14ecb 100644
--- a/test/assertions.js
+++ b/test/assertions.js
@@ -1,27 +1,27 @@
-var _ = require('lodash');
-var fs = require('fs');
-var path = require('path');
-var should = require('should');
-var cheerio = require('cheerio');
+var _ = require("lodash");
+var fs = require("fs");
+var path = require("path");
+var should = require("should");
+var cheerio = require("cheerio");
-should.Assertion.add('file', function(file, description) {
- this.params = { actual: this.obj.toString(), operator: 'have file ' + file, message: description };
+should.Assertion.add("file", function(file, description) {
+ this.params = { actual: this.obj.toString(), operator: "have file " + file, message: description };
- this.obj.should.have.property('options').which.is.an.Object;
- this.obj.options.should.have.property('output').which.is.a.String;
+ this.obj.should.have.property("options").which.is.an.Object();
+ this.obj.options.should.have.property("output").which.is.a.String();
this.assert(fs.existsSync(path.resolve(this.obj.options.output, file)));
});
-should.Assertion.add('jsonfile', function(file, description) {
- this.params = { actual: this.obj.toString(), operator: 'have valid jsonfile ' + file, message: description };
+should.Assertion.add("jsonfile", function(file, description) {
+ this.params = { actual: this.obj.toString(), operator: "have valid jsonfile " + file, message: description };
- this.obj.should.have.property('options').which.is.an.Object;
- this.obj.options.should.have.property('output').which.is.a.String;
+ this.obj.should.have.property("options").which.is.an.Object();
+ this.obj.options.should.have.property("output").which.is.a.String();
this.assert(JSON.parse(fs.readFileSync(path.resolve(this.obj.options.output, file), { encoding: "utf-8" })));
});
-should.Assertion.add('html', function(rules, description) {
- this.params = { actual: "HTML string", operator: 'valid html', message: description };
+should.Assertion.add("html", function(rules, description) {
+ this.params = { actual: "HTML string", operator: "valid html", message: description };
var $ = cheerio.load(this.obj);
_.each(rules, function(validations, query) {
@@ -60,7 +60,7 @@ should.Assertion.add('html', function(rules, description) {
// Test attributes
_.each(validations.attributes, function(value, name) {
var attr = $el.attr(name);
- should(attr).be.ok;
+ should(attr).be.ok();
attr.should.be.equal(value);
});
});