diff options
Diffstat (limited to 'test/images.js')
-rw-r--r-- | test/images.js | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/test/images.js b/test/images.js index 75bc529..de45066 100644 --- a/test/images.js +++ b/test/images.js @@ -1,9 +1,9 @@ -var fs = require('fs'); -var _ = require('lodash'); -var path = require('path'); -var cheerio = require('cheerio'); +var fs = require("fs"); +var _ = require("lodash"); +var path = require("path"); +var cheerio = require("cheerio"); -describe('Images', function () { +describe("Images", function () { var book, readme, $, $img, srcs; before(function() { @@ -17,38 +17,40 @@ describe('Images', function () { ); $ = cheerio.load(readme); $img = $("img"); - srcs = $img.map(function() { return $(this).attr("src"); }) + srcs = $img.map(function() { + return $(this).attr("src"); + }); }); }); - it('should detect all images', function() { + it("should detect all images", function() { _.uniq(srcs).should.have.lengthOf(4); }); - it('should keep image tags', function() { + it("should keep image tags", function() { srcs.should.have.lengthOf(5); }); - it('should not have .svg files', function() { + it("should not have .svg files", function() { _.each(srcs, function(src) { path.extname(src).should.not.equal(".svg"); }); }); - it('should correctly convert svg images to png', function() { + it("should correctly convert svg images to png", function() { _.each(srcs, function(src) { book.should.have.file(src); }); }); - it('should handle relative paths', function() { + it("should handle relative paths", function() { var PAGE = fs.readFileSync( path.join(book.options.output, "folder/PAGE.html"), { encoding: "utf-8" } ); PAGE.should.be.html({ - "img[src='../test.png']": { + "img[src=\"../test.png\"]": { count: 1 } }); |