Adds CSS option to the CLI

This commit is contained in:
fardog
2015-02-02 19:02:45 -08:00
parent c4639d11c8
commit 3a96682b9c
6 changed files with 61 additions and 5 deletions

View File

@@ -80,6 +80,35 @@ test('output of multiple svg', function(t) {
})
})
test('output including CSS', function(t) {
t.plan(5)
var expected = ['test.mermaid.png']
, opt = clone(singleFile)
, filename
, one
, two
opt.png = true
mermaid.process(opt.files, opt, function(code) {
t.equal(code, 0, 'has clean exit code')
filename = path.join(opt.outputDir, path.basename(expected[0]))
one = fs.statSync(filename)
opt.css = fs.readFileSync('test/fixtures/test.css', 'utf8')
mermaid.process(opt.files, opt, function(code) {
t.equal(code, 0, 'has clean exit code')
two = fs.statSync(filename)
t.notEqual(one.size, two.size)
verifyFiles(expected, opt.outputDir, t)
})
})
})
function verifyFiles(expected, dir, t) {
async.each(
expected