@ -171,291 +171,291 @@ describe('testRunner', () => {
} )
} )
} )
} )
// describe('assert library NOTEQUAL method tests', () => {
describe ( 'assert library NOTEQUAL method tests' , ( ) = > {
// const filename: string = __dirname + '/examples_0/assert_notEqual_test.sol'
const filename : string = __dirname + '/examples_0/assert_notEqual_test.sol'
// beforeAll((done) => {
beforeAll ( ( done ) = > {
// compileAndDeploy(filename, (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) => {
compileAndDeploy ( filename , ( _err : Error | null | undefined , compilationData : object , contracts : any , asts : any , accounts : string [ ] ) = > {
// runTest('AssertNotEqualTest', contracts.AssertNotEqualTest, compilationData[filename]['AssertNotEqualTest'], asts[filename], { accounts }, testCallback, resultsCallback(done))
runTest ( 'AssertNotEqualTest' , contracts . AssertNotEqualTest , compilationData [ filename ] [ 'AssertNotEqualTest' ] , asts [ filename ] , { accounts } , testCallback , resultsCallback ( done ) )
// })
} )
// })
} )
// afterAll(() => { tests = [] })
afterAll ( ( ) = > { tests = [ ] } )
// it('should have 6 passing test', () => {
it ( 'should have 6 passing test' , ( ) = > {
// assert.equal(results.passingNum, 6)
assert . equal ( results . passingNum , 6 )
// })
} )
// it('should have 6 failing test', () => {
it ( 'should have 6 failing test' , ( ) = > {
// assert.equal(results.failureNum, 6)
assert . equal ( results . failureNum , 6 )
// })
} )
// it('should return', () => {
it ( 'should return' , ( ) = > {
// deepEqualExcluding(tests, [
deepEqualExcluding ( tests , [
// { type: 'accountList', value: accounts },
{ type : 'accountList' , value : accounts } ,
// { type: 'contract', value: 'AssertNotEqualTest', filename: __dirname + '/examples_0/assert_notEqual_test.sol' },
{ type : 'contract' , value : 'AssertNotEqualTest' , filename : __dirname + '/examples_0/assert_notEqual_test.sol' } ,
// { type: 'testPass', value: 'Not equal uint pass test', context: 'AssertNotEqualTest' },
{ type : 'testPass' , value : 'Not equal uint pass test' , context : 'AssertNotEqualTest' } ,
// { type: 'testFailure', value: 'Not equal uint fail test', errMsg: 'notEqualUintFailTest fails', context: 'AssertNotEqualTest', assertMethod: 'notEqual', expected: '1', returned: '1'},
{ type : 'testFailure' , value : 'Not equal uint fail test' , errMsg : 'notEqualUintFailTest fails' , context : 'AssertNotEqualTest' , assertMethod : 'notEqual' , location : '288:63:0' , expected : '1' , returned : '1' } ,
// { type: 'testPass', value: 'Not equal int pass test', context: 'AssertNotEqualTest' },
{ type : 'testPass' , value : 'Not equal int pass test' , context : 'AssertNotEqualTest' } ,
// { type: 'testFailure', value: 'Not equal int fail test', errMsg: 'notEqualIntFailTest fails', context: 'AssertNotEqualTest', assertMethod: 'notEqual', expected: '-2', returned: '-2'},
{ type : 'testFailure' , value : 'Not equal int fail test' , errMsg : 'notEqualIntFailTest fails' , context : 'AssertNotEqualTest' , assertMethod : 'notEqual' , location : '525:52:0' , expected : '-2' , returned : '-2' } ,
// { type: 'testPass', value: 'Not equal bool pass test', context: 'AssertNotEqualTest' },
{ type : 'testPass' , value : 'Not equal bool pass test' , context : 'AssertNotEqualTest' } ,
// { type: 'testFailure', value: 'Not equal bool fail test', errMsg: 'notEqualBoolFailTest fails', context: 'AssertNotEqualTest', assertMethod: 'notEqual', expected: true, returned: true},
{ type : 'testFailure' , value : 'Not equal bool fail test' , errMsg : 'notEqualBoolFailTest fails' , context : 'AssertNotEqualTest' , assertMethod : 'notEqual' , location : '760:57:0' , expected : true , returned : true } ,
// { type: 'testPass', value: 'Not equal address pass test', context: 'AssertNotEqualTest' },
{ type : 'testPass' , value : 'Not equal address pass test' , context : 'AssertNotEqualTest' } ,
// { type: 'testFailure', value: 'Not equal address fail test', errMsg: 'notEqualAddressFailTest fails', context: 'AssertNotEqualTest', assertMethod: 'notEqual', expected: 0x7994f14563F39875a2F934Ce42cAbF48a93FdDA9, returned: 0x7994f14563F39875a2F934Ce42cAbF48a93FdDA9},
{ type : 'testFailure' , value : 'Not equal address fail test' , errMsg : 'notEqualAddressFailTest fails' , context : 'AssertNotEqualTest' , assertMethod : 'notEqual' , location : '1084:136:0' , expected : 0x7994f14563F39875a2F934Ce42cAbF48a93FdDA9 , returned : 0x7994f14563F39875a2F934Ce42cAbF48a93FdDA9 } ,
// { type: 'testPass', value: 'Not equal bytes32 pass test', context: 'AssertNotEqualTest' },
{ type : 'testPass' , value : 'Not equal bytes32 pass test' , context : 'AssertNotEqualTest' } ,
// { type: 'testFailure', value: 'Not equal bytes32 fail test', errMsg: 'notEqualBytes32FailTest fails', context: 'AssertNotEqualTest', assertMethod: 'notEqual', expected: '0x72656d6978000000000000000000000000000000000000000000000000000000', returned: '0x72656d6978000000000000000000000000000000000000000000000000000000'},
{ type : 'testFailure' , value : 'Not equal bytes32 fail test' , errMsg : 'notEqualBytes32FailTest fails' , context : 'AssertNotEqualTest' , assertMethod : 'notEqual' , location : '1756:54:0' , expected : '0x72656d6978000000000000000000000000000000000000000000000000000000' , returned : '0x72656d6978000000000000000000000000000000000000000000000000000000'} ,
// { type: 'testPass', value: 'Not equal string pass test', context: 'AssertNotEqualTest' },
{ type : 'testPass' , value : 'Not equal string pass test' , context : 'AssertNotEqualTest' } ,
// { type: 'testFailure', value: 'Not equal string fail test', errMsg: 'notEqualStringFailTest fails', context: 'AssertNotEqualTest', assertMethod: 'notEqual', expected: 'remix', returned: 'remix'},
{ type : 'testFailure' , value : 'Not equal string fail test' , errMsg : 'notEqualStringFailTest fails' , context : 'AssertNotEqualTest' , assertMethod : 'notEqual' , location : '2026:81:0' , expected : 'remix' , returned : 'remix' } ,
// ], ['time'])
] , [ 'time' ] )
// })
} )
// })
} )
// describe('assert library GREATERTHAN method tests', () => {
describe ( 'assert library GREATERTHAN method tests' , ( ) = > {
// const filename: string = __dirname + '/examples_0/assert_greaterThan_test.sol'
const filename : string = __dirname + '/examples_0/assert_greaterThan_test.sol'
// beforeAll((done) => {
beforeAll ( ( done ) = > {
// compileAndDeploy(filename, (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) => {
compileAndDeploy ( filename , ( _err : Error | null | undefined , compilationData : object , contracts : any , asts : any , accounts : string [ ] ) = > {
// runTest('AssertGreaterThanTest', contracts.AssertGreaterThanTest, compilationData[filename]['AssertGreaterThanTest'], asts[filename], { accounts }, testCallback, resultsCallback(done))
runTest ( 'AssertGreaterThanTest' , contracts . AssertGreaterThanTest , compilationData [ filename ] [ 'AssertGreaterThanTest' ] , asts [ filename ] , { accounts } , testCallback , resultsCallback ( done ) )
// })
} )
// })
} )
// afterAll(() => { tests = [] })
afterAll ( ( ) = > { tests = [ ] } )
// it('should have 4 passing test', () => {
it ( 'should have 4 passing test' , ( ) = > {
// assert.equal(results.passingNum, 4)
assert . equal ( results . passingNum , 4 )
// })
} )
// it('should have 4 failing test', () => {
it ( 'should have 4 failing test' , ( ) = > {
// assert.equal(results.failureNum, 4)
assert . equal ( results . failureNum , 4 )
// })
} )
// it('should return', () => {
it ( 'should return' , ( ) = > {
// deepEqualExcluding(tests, [
deepEqualExcluding ( tests , [
// { type: 'accountList', value: accounts },
{ type : 'accountList' , value : accounts } ,
// { type: 'contract', value: 'AssertGreaterThanTest', filename: __dirname + '/examples_0/assert_greaterThan_test.sol' },
{ type : 'contract' , value : 'AssertGreaterThanTest' , filename : __dirname + '/examples_0/assert_greaterThan_test.sol' } ,
// { type: 'testPass', value: 'Greater than uint pass test', context: 'AssertGreaterThanTest' },
{ type : 'testPass' , value : 'Greater than uint pass test' , context : 'AssertGreaterThanTest' } ,
// { type: 'testFailure', value: 'Greater than uint fail test', errMsg: 'greaterThanUintFailTest fails', context: 'AssertGreaterThanTest', assertMethod: 'greaterThan', expected: '4', returned: '1'},
{ type : 'testFailure' , value : 'Greater than uint fail test' , errMsg : 'greaterThanUintFailTest fails' , context : 'AssertGreaterThanTest' , assertMethod : 'greaterThan' , location : '303:69:0' , expected : '4' , returned : '1' } ,
// { type: 'testPass', value: 'Greater than int pass test', context: 'AssertGreaterThanTest' },
{ type : 'testPass' , value : 'Greater than int pass test' , context : 'AssertGreaterThanTest' } ,
// { type: 'testFailure', value: 'Greater than int fail test', errMsg: 'greaterThanIntFailTest fails', context: 'AssertGreaterThanTest', assertMethod: 'greaterThan', expected: '1', returned: '-1'},
{ type : 'testFailure' , value : 'Greater than int fail test' , errMsg : 'greaterThanIntFailTest fails' , context : 'AssertGreaterThanTest' , assertMethod : 'greaterThan' , location : '569:67:0' , expected : '1' , returned : '-1' } ,
// { type: 'testPass', value: 'Greater than uint int pass test', context: 'AssertGreaterThanTest' },
{ type : 'testPass' , value : 'Greater than uint int pass test' , context : 'AssertGreaterThanTest' } ,
// { type: 'testFailure', value: 'Greater than uint int fail test', errMsg: 'greaterThanUintIntFailTest fails', context: 'AssertGreaterThanTest', assertMethod: 'greaterThan', expected: '2', returned: '1'},
{ type : 'testFailure' , value : 'Greater than uint int fail test' , errMsg : 'greaterThanUintIntFailTest fails' , context : 'AssertGreaterThanTest' , assertMethod : 'greaterThan' , location : '845:71:0' , expected : '2' , returned : '1' } ,
// { type: 'testPass', value: 'Greater than int uint pass test', context: 'AssertGreaterThanTest' },
{ type : 'testPass' , value : 'Greater than int uint pass test' , context : 'AssertGreaterThanTest' } ,
// { type: 'testFailure', value: 'Greater than int uint fail test', errMsg: 'greaterThanIntUintFailTest fails', context: 'AssertGreaterThanTest', assertMethod: 'greaterThan', expected: '115792089237316195423570985008687907853269984665640564039457584007913129639836', returned: '100'}
{ type : 'testFailure' , value : 'Greater than int uint fail test' , errMsg : 'greaterThanIntUintFailTest fails' , context : 'AssertGreaterThanTest' , assertMethod : 'greaterThan' , location : '1125:76:0' , expected : '115792089237316195423570985008687907853269984665640564039457584007913129639836' , returned : '100'}
// ], ['time'])
] , [ 'time' ] )
// })
} )
// })
} )
// describe('assert library LESSERTHAN method tests', () => {
describe ( 'assert library LESSERTHAN method tests' , ( ) = > {
// const filename: string = __dirname + '/examples_0/assert_lesserThan_test.sol'
const filename : string = __dirname + '/examples_0/assert_lesserThan_test.sol'
// beforeAll((done) => {
beforeAll ( ( done ) = > {
// compileAndDeploy(filename, (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) => {
compileAndDeploy ( filename , ( _err : Error | null | undefined , compilationData : object , contracts : any , asts : any , accounts : string [ ] ) = > {
// runTest('AssertLesserThanTest', contracts.AssertLesserThanTest, compilationData[filename]['AssertLesserThanTest'], asts[filename], { accounts }, testCallback, resultsCallback(done))
runTest ( 'AssertLesserThanTest' , contracts . AssertLesserThanTest , compilationData [ filename ] [ 'AssertLesserThanTest' ] , asts [ filename ] , { accounts } , testCallback , resultsCallback ( done ) )
// })
} )
// })
} )
// afterAll(() => { tests = [] })
afterAll ( ( ) = > { tests = [ ] } )
// it('should have 4 passing test', () => {
it ( 'should have 4 passing test' , ( ) = > {
// assert.equal(results.passingNum, 4)
assert . equal ( results . passingNum , 4 )
// })
} )
// it('should have 4 failing test', () => {
it ( 'should have 4 failing test' , ( ) = > {
// assert.equal(results.failureNum, 4)
assert . equal ( results . failureNum , 4 )
// })
} )
// it('should return', () => {
it ( 'should return' , ( ) = > {
// deepEqualExcluding(tests, [
deepEqualExcluding ( tests , [
// { type: 'accountList', value: accounts },
{ type : 'accountList' , value : accounts } ,
// { type: 'contract', value: 'AssertLesserThanTest', filename: __dirname + '/examples_0/assert_lesserThan_test.sol' },
{ type : 'contract' , value : 'AssertLesserThanTest' , filename : __dirname + '/examples_0/assert_lesserThan_test.sol' } ,
// { type: 'testPass', value: 'Lesser than uint pass test', context: 'AssertLesserThanTest' },
{ type : 'testPass' , value : 'Lesser than uint pass test' , context : 'AssertLesserThanTest' } ,
// { type: 'testFailure', value: 'Lesser than uint fail test', errMsg: 'lesserThanUintFailTest fails', context: 'AssertLesserThanTest', assertMethod: 'lesserThan', expected: '2', returned: '4'},
{ type : 'testFailure' , value : 'Lesser than uint fail test' , errMsg : 'lesserThanUintFailTest fails' , context : 'AssertLesserThanTest' , assertMethod : 'lesserThan' , location : '298:67:0' , expected : '2' , returned : '4' } ,
// { type: 'testPass', value: 'Lesser than int pass test', context: 'AssertLesserThanTest' },
{ type : 'testPass' , value : 'Lesser than int pass test' , context : 'AssertLesserThanTest' } ,
// { type: 'testFailure', value: 'Lesser than int fail test', errMsg: 'lesserThanIntFailTest fails', context: 'AssertLesserThanTest', assertMethod: 'lesserThan', expected: '-1', returned: '1'},
{ type : 'testFailure' , value : 'Lesser than int fail test' , errMsg : 'lesserThanIntFailTest fails' , context : 'AssertLesserThanTest' , assertMethod : 'lesserThan' , location : '557:65:0' , expected : '-1' , returned : '1' } ,
// { type: 'testPass', value: 'Lesser than uint int pass test', context: 'AssertLesserThanTest' },
{ type : 'testPass' , value : 'Lesser than uint int pass test' , context : 'AssertLesserThanTest' } ,
// { type: 'testFailure', value: 'Lesser than uint int fail test', errMsg: 'lesserThanUintIntFailTest fails', context: 'AssertLesserThanTest', assertMethod: 'lesserThan', expected: '-1', returned: '115792089237316195423570985008687907853269984665640564039457584007913129639935'},
{ type : 'testFailure' , value : 'Lesser than uint int fail test' , errMsg : 'lesserThanUintIntFailTest fails' , context : 'AssertLesserThanTest' , assertMethod : 'lesserThan' , location : '826:71:0' , expected : '-1' , returned : '115792089237316195423570985008687907853269984665640564039457584007913129639935' } ,
// { type: 'testPass', value: 'Lesser than int uint pass test', context: 'AssertLesserThanTest' },
{ type : 'testPass' , value : 'Lesser than int uint pass test' , context : 'AssertLesserThanTest' } ,
// { type: 'testFailure', value: 'Lesser than int uint fail test', errMsg: 'lesserThanIntUintFailTest fails', context: 'AssertLesserThanTest', assertMethod: 'lesserThan', expected: '1', returned: '1'},
{ type : 'testFailure' , value : 'Lesser than int uint fail test' , errMsg : 'lesserThanIntUintFailTest fails' , context : 'AssertLesserThanTest' , assertMethod : 'lesserThan' , location : '1105:69:0' , expected : '1' , returned : '1' } ,
// ], ['time'])
] , [ 'time' ] )
// })
} )
// })
} )
// describe('test with beforeAll', () => {
describe ( 'test with beforeAll' , ( ) = > {
// const filename: string = __dirname + '/examples_1/simple_storage_test.sol'
const filename : string = __dirname + '/examples_1/simple_storage_test.sol'
// beforeAll((done) => {
beforeAll ( ( done ) = > {
// compileAndDeploy(filename, (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) => {
compileAndDeploy ( filename , ( _err : Error | null | undefined , compilationData : object , contracts : any , asts : any , accounts : string [ ] ) = > {
// runTest('MyTest', contracts.MyTest, compilationData[filename]['MyTest'], asts[filename], { accounts }, testCallback, resultsCallback(done))
runTest ( 'MyTest' , contracts . MyTest , compilationData [ filename ] [ 'MyTest' ] , asts [ filename ] , { accounts } , testCallback , resultsCallback ( done ) )
// })
} )
// })
} )
// afterAll(() => { tests = [] })
afterAll ( ( ) = > { tests = [ ] } )
// it('should have 3 passing test', () => {
it ( 'should have 3 passing test' , ( ) = > {
// assert.equal(results.passingNum, 3)
assert . equal ( results . passingNum , 3 )
// })
} )
// it('should have 1 failing test', () => {
it ( 'should have 1 failing test' , ( ) = > {
// assert.equal(results.failureNum, 1)
assert . equal ( results . failureNum , 1 )
// })
} )
// it('should return 6 messages', () => {
it ( 'should return 6 messages' , ( ) = > {
// deepEqualExcluding(tests, [
deepEqualExcluding ( tests , [
// { type: 'accountList', value: accounts },
{ type : 'accountList' , value : accounts } ,
// { type: 'contract', value: 'MyTest', filename: __dirname + '/examples_1/simple_storage_test.sol' },
{ type : 'contract' , value : 'MyTest' , filename : __dirname + '/examples_1/simple_storage_test.sol' } ,
// { type: 'testPass', value: 'Initial value should be100', context: 'MyTest' },
{ type : 'testPass' , value : 'Initial value should be100' , context : 'MyTest' } ,
// { type: 'testPass', value: 'Initial value should not be200', context: 'MyTest' },
{ type : 'testPass' , value : 'Initial value should not be200' , context : 'MyTest' } ,
// { type: 'testFailure', value: 'Should trigger one fail', errMsg: 'uint test 1 fails', context: 'MyTest', assertMethod: 'equal', expected: '2', returned: '1'},
{ type : 'testFailure' , value : 'Should trigger one fail' , errMsg : 'uint test 1 fails' , context : 'MyTest' , assertMethod : 'equal' , location : '532:51:1' , expected : '2' , returned : '1' } ,
// { type: 'testPass', value: 'Should trigger one pass', context: 'MyTest' }
{ type : 'testPass' , value : 'Should trigger one pass' , context : 'MyTest' }
// ], ['time'])
] , [ 'time' ] )
// })
} )
// })
} )
// describe('test with beforeEach', () => {
describe ( 'test with beforeEach' , ( ) = > {
// const filename: string = __dirname + '/examples_2/simple_storage_test.sol'
const filename : string = __dirname + '/examples_2/simple_storage_test.sol'
// beforeAll(done => {
beforeAll ( done = > {
// compileAndDeploy(filename, function (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) {
compileAndDeploy ( filename , function ( _err : Error | null | undefined , compilationData : object , contracts : any , asts : any , accounts : string [ ] ) {
// runTest('MyTest', contracts.MyTest, compilationData[filename]['MyTest'], asts[filename], { accounts }, testCallback, resultsCallback(done))
runTest ( 'MyTest' , contracts . MyTest , compilationData [ filename ] [ 'MyTest' ] , asts [ filename ] , { accounts } , testCallback , resultsCallback ( done ) )
// })
} )
// })
} )
// afterAll(() => { tests = [] })
afterAll ( ( ) = > { tests = [ ] } )
// it('should have 2 passing tests', () => {
it ( 'should have 2 passing tests' , ( ) = > {
// assert.equal(results.passingNum, 2)
assert . equal ( results . passingNum , 2 )
// })
} )
// it('should 0 failing tests', () => {
it ( 'should 0 failing tests' , ( ) = > {
// assert.equal(results.failureNum, 0)
assert . equal ( results . failureNum , 0 )
// })
} )
// it('should return 4 messages', () => {
it ( 'should return 4 messages' , ( ) = > {
// deepEqualExcluding(tests, [
deepEqualExcluding ( tests , [
// { type: 'accountList', value: accounts },
{ type : 'accountList' , value : accounts } ,
// { type: 'contract', value: 'MyTest', filename: __dirname + '/examples_2/simple_storage_test.sol' },
{ type : 'contract' , value : 'MyTest' , filename : __dirname + '/examples_2/simple_storage_test.sol' } ,
// { type: 'testPass', value: 'Initial value should be100', context: 'MyTest' },
{ type : 'testPass' , value : 'Initial value should be100' , context : 'MyTest' } ,
// { type: 'testPass', value: 'Value is set200', context: 'MyTest' }
{ type : 'testPass' , value : 'Value is set200' , context : 'MyTest' }
// ], ['time'])
] , [ 'time' ] )
// })
} )
// })
} )
// // Test string equality
// Test string equality
// describe('test string equality', () => {
describe ( 'test string equality' , ( ) = > {
// const filename: string = __dirname + '/examples_3/simple_string_test.sol'
const filename : string = __dirname + '/examples_3/simple_string_test.sol'
// beforeAll(done => {
beforeAll ( done = > {
// compileAndDeploy(filename, function (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) {
compileAndDeploy ( filename , function ( _err : Error | null | undefined , compilationData : object , contracts : any , asts : any , accounts : string [ ] ) {
// runTest('StringTest', contracts.StringTest, compilationData[filename]['StringTest'], asts[filename], { accounts }, testCallback, resultsCallback(done))
runTest ( 'StringTest' , contracts . StringTest , compilationData [ filename ] [ 'StringTest' ] , asts [ filename ] , { accounts } , testCallback , resultsCallback ( done ) )
// })
} )
// })
} )
// afterAll(() => { tests = [] })
afterAll ( ( ) = > { tests = [ ] } )
// it('should 2 passing tests', () => {
it ( 'should 2 passing tests' , ( ) = > {
// assert.equal(results.passingNum, 2)
assert . equal ( results . passingNum , 2 )
// })
} )
// it('should return 4 messages', () => {
it ( 'should return 4 messages' , ( ) = > {
// deepEqualExcluding(tests, [
deepEqualExcluding ( tests , [
// { type: 'accountList', value: accounts },
{ type : 'accountList' , value : accounts } ,
// { type: 'contract', value: 'StringTest', filename: __dirname + '/examples_3/simple_string_test.sol' },
{ type : 'contract' , value : 'StringTest' , filename : __dirname + '/examples_3/simple_string_test.sol' } ,
// { type: 'testPass', value: 'Initial value should be hello world', context: 'StringTest' },
{ type : 'testPass' , value : 'Initial value should be hello world' , context : 'StringTest' } ,
// { type: 'testPass', value: 'Value should not be hello wordl', context: 'StringTest' }
{ type : 'testPass' , value : 'Value should not be hello wordl' , context : 'StringTest' }
// ], ['time'])
] , [ 'time' ] )
// })
} )
// })
} )
// // Test multiple directory import in test contract
// Test multiple directory import in test contract
// describe( 'test multiple directory import in test contract', () = > {
describe ( 'test multiple directory import in test contract', ( ) = > {
// const filename: string = __dirname + '/examples_5/test/simple_storage_test.sol'
const filename : string = __dirname + '/examples_5/test/simple_storage_test.sol'
// beforeAll(done => {
beforeAll ( done = > {
// compileAndDeploy(filename, function (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) {
compileAndDeploy ( filename , function ( _err : Error | null | undefined , compilationData : object , contracts : any , asts : any , accounts : string [ ] ) {
// runTest('StorageResolveTest', contracts.StorageResolveTest, compilationData[filename]['StorageResolveTest'], asts[filename], { accounts }, testCallback, resultsCallback(done))
runTest ( 'StorageResolveTest' , contracts . StorageResolveTest , compilationData [ filename ] [ 'StorageResolveTest' ] , asts [ filename ] , { accounts } , testCallback , resultsCallback ( done ) )
// })
} )
// })
} )
// afterAll(() => { tests = [] })
afterAll ( ( ) = > { tests = [ ] } )
// it('should 3 passing tests', () => {
it ( 'should 3 passing tests' , ( ) = > {
// assert.equal(results.passingNum, 3)
assert . equal ( results . passingNum , 3 )
// })
} )
// it('should return 4 messages', () => {
it ( 'should return 4 messages' , ( ) = > {
// deepEqualExcluding(tests, [
deepEqualExcluding ( tests , [
// { type: 'accountList', value: accounts },
{ type : 'accountList' , value : accounts } ,
// { type: 'contract', value: 'StorageResolveTest', filename: __dirname + '/examples_5/test/simple_storage_test.sol' },
{ type : 'contract' , value : 'StorageResolveTest' , filename : __dirname + '/examples_5/test/simple_storage_test.sol' } ,
// { type: 'testPass', value: 'Initial value should be100', context: 'StorageResolveTest' },
{ type : 'testPass' , value : 'Initial value should be100' , context : 'StorageResolveTest' } ,
// { type: 'testPass', value: 'Check if even', context: 'StorageResolveTest' },
{ type : 'testPass' , value : 'Check if even' , context : 'StorageResolveTest' } ,
// { type: 'testPass', value: 'Check if odd', context: 'StorageResolveTest' }
{ type : 'testPass' , value : 'Check if odd' , context : 'StorageResolveTest' }
// ], ['time'])
] , [ 'time' ] )
// })
} )
// })
} )
// // Test signed/unsigned integer weight
//Test signed/unsigned integer weight
// describe('test number weight', () => {
describe ( 'test number weight' , ( ) = > {
// const filename: string = __dirname + '/number/number_test.sol'
const filename : string = __dirname + '/number/number_test.sol'
// beforeAll(done => {
beforeAll ( done = > {
// compileAndDeploy(filename, function (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) {
compileAndDeploy ( filename , function ( _err : Error | null | undefined , compilationData : object , contracts : any , asts : any , accounts : string [ ] ) {
// runTest('IntegerTest', contracts.IntegerTest, compilationData[filename]['IntegerTest'], asts[filename], { accounts }, testCallback, resultsCallback(done))
runTest ( 'IntegerTest' , contracts . IntegerTest , compilationData [ filename ] [ 'IntegerTest' ] , asts [ filename ] , { accounts } , testCallback , resultsCallback ( done ) )
// })
} )
// })
} )
// afterAll(() => { tests = [] })
afterAll ( ( ) = > { tests = [ ] } )
// it('should have 6 passing tests', () => {
it ( 'should have 6 passing tests' , ( ) = > {
// assert.equal(results.passingNum, 6)
assert . equal ( results . passingNum , 6 )
// })
} )
// it('should have 2 failing tests', () => {
it ( 'should have 2 failing tests' , ( ) = > {
// assert.equal(results.failureNum, 2)
assert . equal ( results . failureNum , 2 )
// })
} )
// })
} )
// // Test Transaction with custom sender & value
// Test Transaction with custom sender & value
// describe('various sender', () => {
describe ( 'various sender' , ( ) = > {
// const filename: string = __dirname + '/various_sender/sender_and_value_test.sol'
const filename : string = __dirname + '/various_sender/sender_and_value_test.sol'
// beforeAll(done => {
beforeAll ( done = > {
// compileAndDeploy(filename, function (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) {
compileAndDeploy ( filename , function ( _err : Error | null | undefined , compilationData : object , contracts : any , asts : any , accounts : string [ ] ) {
// runTest('SenderAndValueTest', contracts.SenderAndValueTest, compilationData[filename]['SenderAndValueTest'], asts[filename], { accounts }, testCallback, resultsCallback(done))
runTest ( 'SenderAndValueTest' , contracts . SenderAndValueTest , compilationData [ filename ] [ 'SenderAndValueTest' ] , asts [ filename ] , { accounts } , testCallback , resultsCallback ( done ) )
// })
} )
// })
} )
// afterAll(() => { tests = [] })
afterAll ( ( ) = > { tests = [ ] } )
// it('should have 17 passing tests', () => {
it ( 'should have 17 passing tests' , ( ) = > {
// assert.equal(results.passingNum, 17)
assert . equal ( results . passingNum , 17 )
// })
} )
// it('should have 0 failing tests', () => {
it ( 'should have 0 failing tests' , ( ) = > {
// assert.equal(results.failureNum, 0)
assert . equal ( results . failureNum , 0 )
// })
} )
// })
} )
// // Test `runTest` method without sending contract object (should throw error)
// Test `runTest` method without sending contract object (should throw error)
// describe( 'runTest method without contract json interface', () = > {
describe ( 'runTest method without contract json interface', ( ) = > {
// const filename: string = __dirname + '/various_sender/sender_and_value_test.sol'
const filename : string = __dirname + '/various_sender/sender_and_value_test.sol'
// const errorCallback: Function = (done) => {
const errorCallback : Function = ( done ) = > {
// return (err, _results) => {
return ( err , _results ) = > {
// if (err && err.message.includes('Contract interface not available')) {
if ( err && err . message . includes ( 'Contract interface not available' ) ) {
// results = _results
results = _results
// done()
done ( )
// }
}
// else throw err
else throw err
// }
}
// }
}
// beforeAll(done => {
beforeAll ( done = > {
// compileAndDeploy(filename, function (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) {
compileAndDeploy ( filename , function ( _err : Error | null | undefined , compilationData : object , contracts : any , asts : any , accounts : string [ ] ) {
// runTest('SenderAndValueTest', undefined, compilationData[filename]['SenderAndValueTest'], asts[filename], { accounts }, testCallback, errorCallback(done))
runTest ( 'SenderAndValueTest' , undefined , compilationData [ filename ] [ 'SenderAndValueTest' ] , asts [ filename ] , { accounts } , testCallback , errorCallback ( done ) )
// })
} )
// })
} )
// it('should have 0 passing tests', () => {
it ( 'should have 0 passing tests' , ( ) = > {
// assert.equal(results.passingNum, 0)
assert . equal ( results . passingNum , 0 )
// })
} )
// it('should have 0 failing tests', () => {
it ( 'should have 0 failing tests' , ( ) = > {
// assert.equal(results.failureNum, 0)
assert . equal ( results . failureNum , 0 )
// })
} )
// })
} )
} )
} )
} )
} )