mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-02 13:49:37 +02:00
Inherit environment variables when testing
This commit is contained in:
@@ -4,6 +4,7 @@ const path = require('path')
|
||||
const test = require('tape')
|
||||
const rimraf = require('rimraf')
|
||||
|
||||
const localSearchPath = './node_modules/.bin' + path.delimiter + process.env.PATH
|
||||
const testDir = 'test/fixtures/samples/'.replace('/', path.sep)
|
||||
const phantomjs = 'node_modules/.bin/phantomjs '.replace('/', path.sep)
|
||||
const loadHtmlSaveScreenshotPngScripts = testDir + path.sep + 'load_html_save_screenshot_png.phantomjs'
|
||||
@@ -28,12 +29,7 @@ function execPhantomjsToLoadHtmlSaveScreenshotPng (html, verify) {
|
||||
function execCmd (cmd, verify) {
|
||||
console.log('cmd: ', cmd)
|
||||
exec(cmd,
|
||||
{ env: {
|
||||
PATH: './node_modules/.bin' + path.delimiter + process.env.PATH,
|
||||
|
||||
// https://github.com/ariya/phantomjs/issues/14376
|
||||
QT_QPA_PLATFORM: 'offscreen'
|
||||
} },
|
||||
{ env: Object.assign({}, process.env, { PATH: localSearchPath }) },
|
||||
function (error, stdout, stderr) {
|
||||
console.log('error:', error, '\nstdout:\n', stdout, '\nstderr:\n', stderr)
|
||||
verify(error, stdout, stderr)
|
||||
|
Reference in New Issue
Block a user