Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
7363f0c3
Commit
7363f0c3
authored
Jan 05, 2021
by
aniket-engg
Committed by
Aniket
Jan 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests for specific blob github import
parent
e84d3760
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
test.ts
libs/remix-url-resolver/tests/test.ts
+31
-0
No files found.
libs/remix-url-resolver/tests/test.ts
View file @
7363f0c3
...
...
@@ -85,6 +85,37 @@ describe('testRunner', () => {
assert
.
deepEqual
(
results
,
expt
)
})
})
// Test github import for specific blob
describe
(
'test getting github imports for specific blob'
,
()
=>
{
const
urlResolver
=
new
RemixURLResolver
()
const
fileName
:
string
=
'https://github.com/ethereum/remix-project/blob/v0.10.7/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 https imports
describe
(
'test getting https imports'
,
()
=>
{
const
urlResolver
=
new
RemixURLResolver
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment