mirror of
https://github.com/sourcey/spectacle.git
synced 2024-09-17 16:38:10 +03:00
Added basic testing of the preprocessor. Setup Mocha.
This commit is contained in:
parent
1315823043
commit
20fce13763
@ -8,7 +8,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "spectacle -l test/fixtures/cheese.png test/fixtures/cheese.json",
|
||||
"test": "node bin/spectacle -l test/fixtures/cheese.png test/fixtures/cheese.json",
|
||||
"test": "mocha && node bin/spectacle -l test/fixtures/cheese.png test/fixtures/cheese.json",
|
||||
"develop": "spectacle -d",
|
||||
"start": "spectacle -s"
|
||||
},
|
||||
@ -54,5 +54,9 @@
|
||||
"marked": "^0.3.5",
|
||||
"tmp": "0.0.31",
|
||||
"trace": "^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "^3.5.0",
|
||||
"mocha": "^3.2.0"
|
||||
}
|
||||
}
|
||||
|
35
test/test-preprocessor.js
Normal file
35
test/test-preprocessor.js
Normal file
@ -0,0 +1,35 @@
|
||||
var chai = require("chai");
|
||||
var should = chai.should();
|
||||
|
||||
var preprocessor = require("../app/lib/preprocessor");
|
||||
|
||||
var minimal = require("./minimal");
|
||||
|
||||
describe("preprocessor", function() {
|
||||
|
||||
var spec = null;
|
||||
var processed = null;
|
||||
|
||||
beforeEach(function() {
|
||||
spec = Object.assign({}, minimal);
|
||||
processed = preprocessor({}, spec);
|
||||
});
|
||||
|
||||
describe("with minimal spec", function() {
|
||||
|
||||
it("should retain initial values", function() {
|
||||
Object.assign({}, processed, minimal).should.deep.equal(processed);
|
||||
});
|
||||
|
||||
it("should add 'tags'", function() {
|
||||
processed.should.have.property("tags");
|
||||
processed.tags.should.deep.equal([]);
|
||||
});
|
||||
|
||||
it("should add 'showTagSummary'", function() {
|
||||
processed.should.have.property("showTagSummary", false);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
Loading…
Reference in New Issue
Block a user