fix runTestSources

pull/5370/head
yann300 6 years ago
parent c2f9507d7f
commit 7186584f14
  1. 11
      remix-tests/src/runTestSources.ts

@ -4,9 +4,10 @@ require('colors')
import { compileContractSources } from './compiler' import { compileContractSources } from './compiler'
import { deployAll } from './deployer' import { deployAll } from './deployer'
import { runTest } from './testRunner' import { runTest } from './testRunner'
import { TestResultInterface, ResultsInterface } from './types'
import Web3 = require('web3') import Web3 = require('web3')
import Provider from 'remix-simulator' import { Provider } from 'remix-simulator'
import { FinalResult } from './types' import { FinalResult } from './types'
const createWeb3Provider = function () { const createWeb3Provider = function () {
@ -28,7 +29,7 @@ export function runTestSources(contractSources, testCallback, resultCallback, fi
}) })
}, },
function compile (next) { function compile (next) {
compileContractSources(contractSources, importFileCb, opts, next) compileContractSources(contractSources, importFileCb, { accounts }, next)
}, },
function deployAllContracts (compilationResult, next) { function deployAllContracts (compilationResult, next) {
deployAll(compilationResult, web3, (err, contracts) => { deployAll(compilationResult, web3, (err, contracts) => {
@ -60,7 +61,7 @@ export function runTestSources(contractSources, testCallback, resultCallback, fi
let totalTime = 0 let totalTime = 0
let errors: any[] = [] let errors: any[] = []
const _testCallback = function (result) { const _testCallback = function (err: Error | null | undefined, result: TestResultInterface) {
if (result.type === 'testFailure') { if (result.type === 'testFailure') {
errors.push(result) errors.push(result)
} }
@ -75,8 +76,8 @@ export function runTestSources(contractSources, testCallback, resultCallback, fi
cb() cb()
} }
async.eachOfLimit(contractsToTest, 1, (contractName, index, cb) => { async.eachOfLimit(contractsToTest, 1, (contractName: string, index, cb) => {
runTest(contractName, contracts(contractName), contractsToTestDetails[index], { accounts }, _testCallback, (err, result) => { runTest(contractName, contracts[contractName], contractsToTestDetails[index], { accounts }, _testCallback, (err, result) => {
if (err) { if (err) {
return cb(err) return cb(err)
} }

Loading…
Cancel
Save