Update readme

pull/7/head
0mkar 6 years ago
parent 5588fe8de4
commit d63c0ceb62
  1. 6
      remix-url-resolver/README.md
  2. 16
      remix-url-resolver/tests/test.ts

@ -18,11 +18,11 @@ Returns `json` object with exact same path as `import` statement.
`resolve(url, urlHandler)` function should be called from within `handleImportCb` function of `solc.compile(input, handleImportCb)`.
```ts
import { RemixResolve } from 'remix-url-resolver'
import { RemixURLResolver } from 'remix-url-resolver'
const remixResolve = new RemixResolve()
const urlResolver = new RemixURLResolver()
const fileName: string = '../greeter.sol'
remixResolve.resolve(fileName, urlHandler)
urlResolver.resolve(fileName, urlHandler)
.then((sources: object) => {
console.log(sources)
})

@ -7,7 +7,7 @@ describe('testRunner', () => {
describe('# RemixResolve.resolve()', () => {
describe('* test without AppManager', () => {
describe('test example_1 [local imports]', () => {
const remixURLResolve = new RemixURLResolver()
const urlResolver = new RemixURLResolver()
const fileName: string = '../remix-url-resolver/tests/example_1/greeter.sol'
let results: object = {}
@ -31,7 +31,7 @@ describe('testRunner', () => {
handle: (match: Array<string>) => { return handleLocal(match[2], match[3]) }
}
]
remixURLResolve.resolve(fileName, localFSHandler)
urlResolver.resolve(fileName, localFSHandler)
.then((sources: object) => {
results = sources
done()
@ -55,12 +55,12 @@ describe('testRunner', () => {
})
// Test github import
describe('test getting github imports', () => {
const remixURLResolve = new RemixURLResolver()
const urlResolver = new RemixURLResolver()
const fileName: string = 'github.com/ethereum/populus/docs/assets/Greeter.sol'
let results: object = {}
before(done => {
remixURLResolve.resolve(fileName)
urlResolver.resolve(fileName)
.then((sources: object) => {
results = sources
done()
@ -84,12 +84,12 @@ describe('testRunner', () => {
})
// Test https imports
describe('test getting https imports', () => {
const remixURLResolve = new RemixURLResolver()
const urlResolver = new RemixURLResolver()
const fileName: string = 'https://gist.githubusercontent.com/roneilr/7901633d7c2f52957d22/raw/d9b9d54760f6e4f4cfbac4b321bee6a6983a1048/greeter.sol'
let results: object = {}
before(done => {
remixURLResolve.resolve(fileName)
urlResolver.resolve(fileName)
.then((sources: object) => {
results = sources
done()
@ -114,12 +114,12 @@ describe('testRunner', () => {
// Test http imports
describe('test getting http imports', () => {
const remixURLResolve = new RemixURLResolver()
const urlResolver = new RemixURLResolver()
const fileName: string = 'http://gist.githubusercontent.com/roneilr/7901633d7c2f52957d22/raw/d9b9d54760f6e4f4cfbac4b321bee6a6983a1048/greeter.sol'
let results: object = {}
before(done => {
remixURLResolve.resolve(fileName)
urlResolver.resolve(fileName)
.then((sources: object) => {
results = sources
done()

Loading…
Cancel
Save