Commit 19c976be authored by aniket-engg's avatar aniket-engg Committed by Aniket

test github imports for branch

parent 0f8c6c62
...@@ -86,6 +86,36 @@ describe('testRunner', () => { ...@@ -86,6 +86,36 @@ describe('testRunner', () => {
}) })
}) })
// Test github import for specific branch
describe('test getting github imports for specific branch', () => {
const urlResolver = new RemixURLResolver()
const fileName: string = 'https://github.com/ethereum/remix-project/blob/remix_beta/libs/remix-url-resolver/tests/example_1/greeter.sol'
let results: object = {}
before(done => {
urlResolver.resolve(fileName)
.then((sources: object) => {
results = sources
done()
})
.catch((e: Error) => {
throw e
})
})
it('should have 3 items', () => {
assert.equal(Object.keys(results).length, 3)
})
it('should return contract content of given github path', () => {
const expt: object = {
cleanUrl: 'ethereum/remix-project/libs/remix-url-resolver/tests/example_1/greeter.sol',
content: fs.readFileSync(__dirname + '/example_1/greeter.sol', { encoding: 'utf8'}) + '\n',
type: 'github'
}
assert.deepEqual(results, expt)
})
})
// Test github import for specific tag // Test github import for specific tag
describe('test getting github imports for specific tag', () => { describe('test getting github imports for specific tag', () => {
const urlResolver = new RemixURLResolver() const urlResolver = new RemixURLResolver()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment