release_version.spec.ts 1.0 KB

1234567891011121314151617181920212223242526272829
  1. import { createConnection, deploy, aliceKeypair, debug_buffer } from "./index";
  2. import expect from 'expect';
  3. import { ContractPromise } from "@polkadot/api-contract";
  4. describe('Deploy release_version.sol and test the debug buffer is empty', () => {
  5. it('removes all debugging', async function () {
  6. let conn = await createConnection();
  7. const alice = aliceKeypair();
  8. let deployed_contract = await deploy(
  9. conn,
  10. alice,
  11. "release.contract",
  12. BigInt(0)
  13. );
  14. let contract = new ContractPromise(
  15. conn,
  16. deployed_contract.abi,
  17. deployed_contract.address
  18. );
  19. // The --release flag should remove all debugging features, making the debug buffer empty
  20. let res = await debug_buffer(conn, contract, `print_then_error`, [20])
  21. expect(res).toEqual("")
  22. let res2 = await debug_buffer(conn, contract, `print_then_error`, [0])
  23. expect(res2).toEqual("")
  24. conn.disconnect();
  25. });
  26. });