mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-15 02:04:08 +01:00
change " to ' per code climate
This commit is contained in:
@@ -12,7 +12,7 @@ module.exports = { process: processMermaid }
|
|||||||
function processMermaid(files, _options, _next) {
|
function processMermaid(files, _options, _next) {
|
||||||
var options = _options || {}
|
var options = _options || {}
|
||||||
, outputDir = options.outputDir || process.cwd()
|
, outputDir = options.outputDir || process.cwd()
|
||||||
, outputSuffix = options.outputSuffix || ""
|
, outputSuffix = options.outputSuffix || ''
|
||||||
, next = _next || function() {}
|
, next = _next || function() {}
|
||||||
, phantomArgs = [
|
, phantomArgs = [
|
||||||
phantomscript
|
phantomscript
|
||||||
|
|||||||
@@ -1,20 +1,17 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var exec = require('child_process').exec;
|
var exec = require('child_process').exec;
|
||||||
var fs = require('fs')
|
var path = require('path')
|
||||||
, path = require('path')
|
|
||||||
|
|
||||||
var test = require('tape')
|
var test = require('tape')
|
||||||
, async = require('async')
|
|
||||||
, clone = require('clone')
|
|
||||||
, rimraf = require('rimraf')
|
, rimraf = require('rimraf')
|
||||||
|
|
||||||
var test_dir = "test/fixtures/samples/".replace('/',path.sep)
|
var test_dir = 'test/fixtures/samples/'.replace('/',path.sep)
|
||||||
|
|
||||||
rimraf.sync(test_dir+'*.actual.*');
|
rimraf.sync(test_dir+'*.actual.*');
|
||||||
|
|
||||||
function exec_mermaid(args, verify) {
|
function exec_mermaid(args, verify) {
|
||||||
exec('bin/mermaid.js ' + args,
|
exec('bin/mermaid.js ' + args,
|
||||||
{env: {PATH: "./node_modules/.bin"+path.delimiter+process.env.PATH}},
|
{env: {PATH: './node_modules/.bin'+path.delimiter+process.env.PATH}},
|
||||||
function(error, stdout, stderr) {
|
function(error, stdout, stderr) {
|
||||||
console.log('error:',error,'\nstdout:\n',stdout,'\nstderr:\n',stderr);
|
console.log('error:',error,'\nstdout:\n',stdout,'\nstderr:\n',stderr);
|
||||||
verify(error, stdout, stderr);
|
verify(error, stdout, stderr);
|
||||||
@@ -23,19 +20,17 @@ function exec_mermaid(args, verify) {
|
|||||||
|
|
||||||
test('mermaid cli help', function(t) {
|
test('mermaid cli help', function(t) {
|
||||||
t.plan(1);
|
t.plan(1);
|
||||||
var args = [ "--help", ]
|
var args = [ '--help' ]
|
||||||
exec_mermaid(args.join(" "),
|
exec_mermaid(args.join(' '), function(error, stdout, stderr) {
|
||||||
function(error, stdout, stderr) {
|
t.notOk(stderr, 'no error')
|
||||||
t.notOk(error, 'no error')
|
|
||||||
t.end()
|
t.end()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('mermaid cli help', function(t) {
|
test('mermaid cli help', function(t) {
|
||||||
t.plan(1);
|
t.plan(1);
|
||||||
var args = [ "--badopt", ]
|
var args = [ '--badopt' ]
|
||||||
exec_mermaid(args.join(" "),
|
exec_mermaid(args.join(' '), function(error, stdout, stderr) {
|
||||||
function(error, stdout, stderr) {
|
|
||||||
t.ok(stderr, 'should get error')
|
t.ok(stderr, 'should get error')
|
||||||
t.end()
|
t.end()
|
||||||
});
|
});
|
||||||
@@ -44,13 +39,12 @@ test('mermaid cli help', function(t) {
|
|||||||
//todo
|
//todo
|
||||||
test.skip('sequence syntax error', function(t) {
|
test.skip('sequence syntax error', function(t) {
|
||||||
t.plan(1);
|
t.plan(1);
|
||||||
var args = [ "--svg",
|
var args = [ '--svg',
|
||||||
"--outputDir=" + test_dir,
|
'--outputDir=' + test_dir,
|
||||||
"--outputSuffix=.actual",
|
'--outputSuffix=.actual',
|
||||||
test_dir+"sequence_err.mmd",
|
test_dir+'sequence_err.mmd'
|
||||||
]
|
]
|
||||||
exec_mermaid(args.join(" "),
|
exec_mermaid(args.join(' '), function(error, stdout, stderr) {
|
||||||
function(error, stdout, stderr) {
|
|
||||||
t.ok(stderr, 'should get error')
|
t.ok(stderr, 'should get error')
|
||||||
t.end()
|
t.end()
|
||||||
});
|
});
|
||||||
@@ -59,14 +53,13 @@ test.skip('sequence syntax error', function(t) {
|
|||||||
['', 'fo', 'tspan', 'old'].forEach(function(textPlacement) {
|
['', 'fo', 'tspan', 'old'].forEach(function(textPlacement) {
|
||||||
test('sequence svg text placelment: '+textPlacement, function(t) {
|
test('sequence svg text placelment: '+textPlacement, function(t) {
|
||||||
t.plan(1);
|
t.plan(1);
|
||||||
var args = [ "--svg",
|
var args = [ '--svg',
|
||||||
"--outputDir=" + test_dir,
|
'--outputDir=' + test_dir,
|
||||||
"--outputSuffix="+(textPlacement ? "_"+textPlacement : "")+".actual",
|
'--outputSuffix='+(textPlacement ? '_'+textPlacement : '')+'.actual',
|
||||||
textPlacement ? "--sequenceConfig="+test_dir+"sequence_text_"+textPlacement+".cfg" : "",
|
textPlacement ? '--sequenceConfig='+test_dir+'sequence_text_'+textPlacement+'.cfg' : '',
|
||||||
test_dir+"sequence_text.mmd",
|
test_dir+'sequence_text.mmd'
|
||||||
]
|
]
|
||||||
exec_mermaid(args.join(" "),
|
exec_mermaid(args.join(' '), function(error, stdout, stderr) {
|
||||||
function(error, stdout, stderr) {
|
|
||||||
t.notOk(stderr, 'no error')
|
t.notOk(stderr, 'no error')
|
||||||
t.end()
|
t.end()
|
||||||
});
|
});
|
||||||
@@ -75,13 +68,12 @@ test.skip('sequence syntax error', function(t) {
|
|||||||
|
|
||||||
test('sequence png', function(t) {
|
test('sequence png', function(t) {
|
||||||
t.plan(1);
|
t.plan(1);
|
||||||
var args = [ "--png",
|
var args = [ '--png',
|
||||||
"--outputDir=" + test_dir,
|
'--outputDir=' + test_dir,
|
||||||
"--outputSuffix=.actual",
|
'--outputSuffix=.actual',
|
||||||
test_dir+"sequence_text.mmd",
|
test_dir+'sequence_text.mmd'
|
||||||
]
|
]
|
||||||
exec_mermaid(args.join(" "),
|
exec_mermaid(args.join(' '), function(error, stdout, stderr) {
|
||||||
function(error, stdout, stderr) {
|
|
||||||
t.notOk(stderr, 'no error')
|
t.notOk(stderr, 'no error')
|
||||||
t.end()
|
t.end()
|
||||||
});
|
});
|
||||||
@@ -89,13 +81,12 @@ test('sequence png', function(t) {
|
|||||||
|
|
||||||
test('flowchart svg text', function(t) {
|
test('flowchart svg text', function(t) {
|
||||||
t.plan(1);
|
t.plan(1);
|
||||||
var args = [ "--svg",
|
var args = [ '--svg',
|
||||||
"--outputDir=" + test_dir,
|
'--outputDir=' + test_dir,
|
||||||
"--outputSuffix=.actual",
|
'--outputSuffix=.actual',
|
||||||
test_dir+"flowchart_text.mmd",
|
test_dir+'flowchart_text.mmd'
|
||||||
]
|
]
|
||||||
exec_mermaid(args.join(" "),
|
exec_mermaid(args.join(' '), function(error, stdout, stderr) {
|
||||||
function(error, stdout, stderr) {
|
|
||||||
t.notOk(stderr, 'no error')
|
t.notOk(stderr, 'no error')
|
||||||
t.end()
|
t.end()
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user