|
|
@ -117,15 +117,11 @@ export class CompilerImports extends Plugin { |
|
|
|
* @param {String} targetPath - (optional) internal path where the content should be saved to |
|
|
|
* @param {String} targetPath - (optional) internal path where the content should be saved to |
|
|
|
* @returns {Promise} - string content |
|
|
|
* @returns {Promise} - string content |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
async resolveAndSave (url, targetPath) { |
|
|
|
async resolveAndSave (url, targetPath, testRunner = null) { |
|
|
|
if (url.indexOf('remix_tests.sol') !== -1 || url.indexOf('remix_accounts.sol') !== -1) { |
|
|
|
if (url.indexOf('remix_tests.sol') !== -1 || url.indexOf('remix_accounts.sol') !== -1) { |
|
|
|
let content |
|
|
|
let content |
|
|
|
if (url === 'remix_tests.sol') content = assertLibCode |
|
|
|
if (url === 'remix_tests.sol') content = assertLibCode |
|
|
|
else if (url === 'remix_accounts.sol') { |
|
|
|
else if (url === 'remix_accounts.sol' && testRunner) content = testRunner.accountsLibCode |
|
|
|
this.testRunner = new UnitTestRunner() |
|
|
|
|
|
|
|
await this.testRunner.init() |
|
|
|
|
|
|
|
content = this.testRunner.accountsLibCode |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const provider = await this.call('fileManager', 'getProviderOf', null) |
|
|
|
const provider = await this.call('fileManager', 'getProviderOf', null) |
|
|
|
if (provider) provider.addExternal('.deps/remix-tests/' + url, content, url) |
|
|
|
if (provider) provider.addExternal('.deps/remix-tests/' + url, content, url) |
|
|
|
return content |
|
|
|
return content |
|
|
|