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
2823b1f0
Commit
2823b1f0
authored
Oct 30, 2020
by
aniket-engg
Committed by
Aniket
Oct 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
default generated file updated
parent
98c0abc7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
testTab.js
apps/remix-ide/src/app/tabs/testTab/testTab.js
+11
-0
No files found.
apps/remix-ide/src/app/tabs/testTab/testTab.js
View file @
2823b1f0
...
@@ -65,6 +65,7 @@ class TestTabLogic {
...
@@ -65,6 +65,7 @@ class TestTabLogic {
const
comment
=
hasCurrent
?
`import "
${
relative
}
/
${
remixPath
.
basename
(
fileToImport
)}
";`
:
'// Import here the file to test.'
const
comment
=
hasCurrent
?
`import "
${
relative
}
/
${
remixPath
.
basename
(
fileToImport
)}
";`
:
'// Import here the file to test.'
return
`pragma solidity >=0.4.22 <0.8.0;
return
`pragma solidity >=0.4.22 <0.8.0;
import "remix_tests.sol"; // this import is automatically injected by Remix.
import "remix_tests.sol"; // this import is automatically injected by Remix.
import "remix_accounts.sol";
${
comment
}
${
comment
}
// File name has to end with '_test.sol', this file can contain more than one testSuite contracts
// File name has to end with '_test.sol', this file can contain more than one testSuite contracts
...
@@ -92,6 +93,16 @@ contract ${contractName} {
...
@@ -92,6 +93,16 @@ contract ${contractName} {
function checkFailure() public {
function checkFailure() public {
Assert.equal(uint(1), uint(2), "1 is not equal to 2");
Assert.equal(uint(1), uint(2), "1 is not equal to 2");
}
}
/// Custom Transaction Context
/// See more: https://remix-ide.readthedocs.io/en/latest/unittesting.html#customization
/// #sender: account-1
/// #value: 100
function checkSenderAndValue() public payable {
// account index varies 0-9, value is in wei
Assert.equal(msg.sender, TestsAccounts.getAccount(1), "Invalid sender");
Assert.equal(msg.value, 100, "Invalid value");
}
}
}
`
`
}
}
...
...
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