Unverified Commit f2b46943 authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #377 from ethereum/remix-testsCLI

remix-tests as CLI should work fine
parents e339feca 0b47f4a8
import commander from 'commander' import commander from 'commander'
import Web3 from 'web3'; import Web3 from 'web3';
import path from 'path'
import { runTestFiles } from './runTestFiles' import { runTestFiles } from './runTestFiles'
import fs from './fileSystem' import fs from './fileSystem'
import { Provider } from '@remix-project/remix-simulator' import { Provider } from '@remix-project/remix-simulator'
...@@ -20,7 +21,7 @@ function mapVerbosity (v: number) { ...@@ -20,7 +21,7 @@ function mapVerbosity (v: number) {
} }
return levels[v] return levels[v]
} }
const version = require('../../../package.json').version const version = require('../package.json').version
commander.version(version) commander.version(version)
...@@ -58,7 +59,7 @@ commander ...@@ -58,7 +59,7 @@ commander
} }
const isDirectory = fs.lstatSync(filename).isDirectory() const isDirectory = fs.lstatSync(filename).isDirectory()
runTestFiles(filename, isDirectory, web3) runTestFiles(path.resolve(filename), isDirectory, web3)
}) })
if (!process.argv.slice(2).length) { if (!process.argv.slice(2).length) {
......
...@@ -106,7 +106,7 @@ export function runTestFiles(filepath: string, isDirectory: boolean, web3: Web3, ...@@ -106,7 +106,7 @@ export function runTestFiles(filepath: string, isDirectory: boolean, web3: Web3,
} else if (result.type === 'testPass') { } else if (result.type === 'testPass') {
signale.result(result.value) signale.result(result.value)
} else if (result.type === 'testFailure') { } else if (result.type === 'testFailure') {
signale.result(result.value.red) signale.error(result.value.red)
errors.push(result) errors.push(result)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment