Merge pull request #8 from ethereum/export_assert_lib

Export assert lib
pull/3094/head
yann300 7 years ago committed by GitHub
commit 43049b2408
  1. 3
      sol/tests.sol.js
  2. 7
      src/compiler.js
  3. 3
      src/index.js

@ -1,3 +1,4 @@
module.exports = `
pragma solidity ^0.4.7;
library Assert {
@ -99,4 +100,4 @@ library Assert {
//}
}
`;

@ -10,7 +10,8 @@ function compileFileOrFiles (filename, isDirectory, cb) {
let compiler, filepath
const sources = {
'tests.sol': {content: fs.readFileSync('sol/tests.sol').toString()}
'tests.sol': {content: require('../sol/tests.sol.js') },
'remix_tests.sol': {content: require('../sol/tests.sol.js') }
}
// TODO: for now assumes filepath dir contains all tests, later all this
@ -48,6 +49,10 @@ function compileFileOrFiles (filename, isDirectory, cb) {
function compileContractSources (sources, cb) {
let compiler, filepath
if(!sources['remix_tests.sol']) {
sources['remix_tests.sol'] = {content: require('../sol/tests.sol.js')}
}
async.waterfall([
function loadCompiler (next) {
compiler = new RemixCompiler()

@ -188,5 +188,6 @@ var runTestFiles = function (filepath, isDirectory, web3) {
module.exports = {
runTestFiles: runTestFiles,
runTestSources: runTestSources,
runTest: TestRunner.runTest
runTest: TestRunner.runTest,
assertLibCode: require('../sol/tests.sol.js')
}

Loading…
Cancel
Save