github.com/neatio-net/neatio@v1.7.3-0.20231114194659-f4d7a2226baa/tests/solidity/test/opCodes.js (about)

     1  const TodoList = artifacts.require('./OpCodes.sol')
     2  const assert = require('assert')
     3  let contractInstance
     4  const Web3 = require('web3');
     5  const web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:9915/neatio'));
     6  
     7  contract('OpCodes', (accounts) => {
     8     beforeEach(async () => {
     9        contractInstance = await TodoList.deployed()
    10     })
    11     it('Should run without errors the majorit of opcodes', async () => {
    12       await contractInstance.test()
    13       await contractInstance.test_stop()
    14  
    15     })
    16  
    17     it('Should throw invalid op code', async () => {
    18      try{
    19        await contractInstance.test_invalid()
    20      }
    21      catch(error) {
    22        console.error(error);
    23      }
    24     })
    25  
    26     it('Should revert', async () => {
    27      try{
    28        await contractInstance.test_revert()    }
    29      catch(error) {
    30        console.error(error);
    31      }
    32     })
    33  })