Skip to content

Commit

Permalink
change " to ' per code climate
Browse files Browse the repository at this point in the history
  • Loading branch information
whyzdev committed Dec 19, 2016
1 parent 4a5bbe1 commit 74ee331
Showing 1 changed file with 28 additions and 31 deletions.
59 changes: 28 additions & 31 deletions test/cli_test-samples.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
'use strict';
var exec = require('child_process').exec;
var fs = require('fs')
, path = require('path')
var path = require('path')

var test = require('tape')
, async = require('async')
, clone = require('clone')
, 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.*');

function exec_mermaid(args, verify) {
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) {
console.log('error:',error,'\nstdout:\n',stdout,'\nstderr:\n',stderr);
verify(error, stdout, stderr);
Expand All @@ -23,8 +20,8 @@ function exec_mermaid(args, verify) {

test('mermaid cli help', function(t) {
t.plan(1);
var args = [ "--help", ]
exec_mermaid(args.join(" "),
var args = [ '--help' ]
exec_mermaid(args.join(' '),
function(error, stdout, stderr) {
t.notOk(error, 'no error')
t.end()
Expand All @@ -33,8 +30,8 @@ test('mermaid cli help', function(t) {

test('mermaid cli help', function(t) {
t.plan(1);
var args = [ "--badopt", ]
exec_mermaid(args.join(" "),
var args = [ '--badopt', ]
exec_mermaid(args.join(' '),
function(error, stdout, stderr) {
t.ok(stderr, 'should get error')
t.end()
Expand All @@ -44,12 +41,12 @@ test('mermaid cli help', function(t) {
//todo
test.skip('sequence syntax error', function(t) {
t.plan(1);
var args = [ "--svg",
"--outputDir=" + test_dir,
"--outputSuffix=.actual",
test_dir+"sequence_err.mmd",
var args = [ '--svg',
'--outputDir=' + test_dir,
'--outputSuffix=.actual',
test_dir+'sequence_err.mmd',
]
exec_mermaid(args.join(" "),
exec_mermaid(args.join(' '),
function(error, stdout, stderr) {
t.ok(stderr, 'should get error')
t.end()
Expand All @@ -59,13 +56,13 @@ test.skip('sequence syntax error', function(t) {
['', 'fo', 'tspan', 'old'].forEach(function(textPlacement) {
test('sequence svg text placelment: '+textPlacement, function(t) {
t.plan(1);
var args = [ "--svg",
"--outputDir=" + test_dir,
"--outputSuffix="+(textPlacement ? "_"+textPlacement : "")+".actual",
textPlacement ? "--sequenceConfig="+test_dir+"sequence_text_"+textPlacement+".cfg" : "",
test_dir+"sequence_text.mmd",
var args = [ '--svg',
'--outputDir=' + test_dir,
'--outputSuffix='+(textPlacement ? '_'+textPlacement : '')+'.actual',
textPlacement ? '--sequenceConfig='+test_dir+'sequence_text_'+textPlacement+'.cfg' : '',
test_dir+'sequence_text.mmd'
]
exec_mermaid(args.join(" "),
exec_mermaid(args.join(' '),
function(error, stdout, stderr) {
t.notOk(stderr, 'no error')
t.end()
Expand All @@ -75,12 +72,12 @@ test.skip('sequence syntax error', function(t) {

test('sequence png', function(t) {
t.plan(1);
var args = [ "--png",
"--outputDir=" + test_dir,
"--outputSuffix=.actual",
test_dir+"sequence_text.mmd",
var args = [ '--png',
'--outputDir=' + test_dir,
'--outputSuffix=.actual',
test_dir+'sequence_text.mmd'
]
exec_mermaid(args.join(" "),
exec_mermaid(args.join(' '),
function(error, stdout, stderr) {
t.notOk(stderr, 'no error')
t.end()
Expand All @@ -89,12 +86,12 @@ test('sequence png', function(t) {

test('flowchart svg text', function(t) {
t.plan(1);
var args = [ "--svg",
"--outputDir=" + test_dir,
"--outputSuffix=.actual",
test_dir+"flowchart_text.mmd",
var args = [ '--svg',
'--outputDir=' + test_dir,
'--outputSuffix=.actual',
test_dir+'flowchart_text.mmd'
]
exec_mermaid(args.join(" "),
exec_mermaid(args.join(' '),
function(error, stdout, stderr) {
t.notOk(stderr, 'no error')
t.end()
Expand Down

0 comments on commit 74ee331

Please sign in to comment.