compiler version tests working fine

pull/741/head
aniket-engg 4 years ago
parent 508dd8e70a
commit 532d2d9834
  1. 13
      libs/remix-tests/src/compiler.ts
  2. 3
      libs/remix-tests/tests/testRunner.cli.spec.ts

@ -129,11 +129,16 @@ export function compileFileOrFiles(filename: string, isDirectory: boolean, opts:
const {currentCompilerUrl, evmVersion, optimize, runs} = compilerConfig
evmVersion ? compiler.set('evmVersion', evmVersion) :
optimize ? compiler.set('optimize', optimize) :
runs ? compiler.set('runs', runs) :
currentCompilerUrl ? compiler.loadRemoteVersion(currentCompilerUrl) : compiler.onInternalCompilerLoaded()
compiler.event.register('compilerLoaded', this, function (version) {
runs ? compiler.set('runs', runs) : ''
if(currentCompilerUrl) {
compiler.loadRemoteVersion(currentCompilerUrl)
compiler.event.register('compilerLoaded', this, function (version) {
next()
});
} else {
compiler.onInternalCompilerLoaded()
next()
});
}
},
function doCompilation(next) {
// @ts-ignore

@ -53,9 +53,8 @@ Commands:
test('remix-tests running a test file with custom compiler version', () => {
const res = spawnSync(executablePath, ['--compiler', '0.7.4', resolve(__dirname + '/examples_0/assert_ok_test.sol')])
console.log('res.stdout.toString().trim()---------->', res.stdout.toString().trim())
// match initial lines
expect(res.stdout.toString().trim()).toMatch(/Loading remote solc version v0.7.4+commit.3f05b770/)
expect(res.stdout.toString().trim().includes('Loading remote solc version v0.7.4+commit.3f05b770')).toBeTruthy()
expect(res.stdout.toString().trim()).toMatch(/:: Running remix-tests - Unit testing for solidity ::/)
expect(res.stdout.toString().trim()).toMatch(/creation of library remix_tests.sol:Assert pending.../)
// match test result

Loading…
Cancel
Save