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