From 560ea38a10ce90590c16edc1181c6a44ef323204 Mon Sep 17 00:00:00 2001 From: 100pah Date: Fri, 24 Apr 2020 00:17:42 +0800 Subject: [PATCH] fix: fix mktest and test facility --- test/build/mktest.js | 22 +++++++++------------- test/lib/caseFrame.css | 4 ++-- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/test/build/mktest.js b/test/build/mktest.js index 9734e9ccf..3c618c94e 100755 --- a/test/build/mktest.js +++ b/test/build/mktest.js @@ -24,11 +24,7 @@ const nodeFS = require('fs'); const assert = require('assert'); const nodePath = require('path'); const commander = require('commander'); -const {color} = require('zrender/build/helper'); - -const colorFgCyanDim = color('fgCyan', 'dim'); -const colorFgGreen = color('fgGreen'); -const colorFgRed = color('fgRed'); +const chalk = require('chalk'); const testDir = nodePath.resolve(__dirname, '..'); const testTplPath = nodePath.resolve(__dirname, 'mktest-tpl.html'); @@ -38,19 +34,19 @@ const tagDomPlace = ''; const tagJSPlace = ''; const manualText = ` - ${colorFgCyanDim('Usage:')} + ${chalk.cyan.dim('Usage:')} # Make a file named "bar-action.html" in directory "echarts/test" with 1 initial chart. - ${colorFgGreen('npm run mktest bar-action')} + ${chalk.green('npm run mktest bar-action')} # or - ${colorFgGreen('npm run mktest bar-action.html')} + ${chalk.green('npm run mktest bar-action.html')} # or - ${colorFgGreen('node ./test/build/mktest bar-action')} + ${chalk.green('node ./test/build/mktest bar-action')} # Make a file named "bar-action.html" in directory "echarts/test" with 5 initial charts. - ${colorFgGreen('npm run mktest bar-action 5')} + ${chalk.green('npm run mktest bar-action 5')} # or - ${colorFgGreen('node ./test/build/mktest bar-action 5')} + ${chalk.green('node ./test/build/mktest bar-action 5')} `; function run() { @@ -73,7 +69,7 @@ function run() { nodeFS.writeFileSync(opt.testFilePath, testFileContent, {encoding: 'utf8'}); - console.log(`A test file has been added in: \n${colorFgGreen(opt.testFilePath)}`); + console.log(`A test file has been added in: \n${chalk.green(opt.testFilePath)}`); console.log(); } @@ -150,7 +146,7 @@ function normalizeInputExt(testFileName) { } function printError(msg) { - console.error(colorFgRed('[ERROR]: ' + msg)); + console.error(chalk.red('[ERROR]: ' + msg)); } run(); diff --git a/test/lib/caseFrame.css b/test/lib/caseFrame.css index 97ad1c723..11816b545 100644 --- a/test/lib/caseFrame.css +++ b/test/lib/caseFrame.css @@ -29,7 +29,7 @@ left: 0; top: 0; bottom: 0; - width: 230px; + width: 250px; overflow: auto; font-size: 13px; } @@ -63,7 +63,7 @@ margin: 10px 0; } .case-frame .page-content { - margin-left: 235px; + margin-left: 255px; height: 100%; padding: 0; position: relative; -- GitLab