Giter Site home page Giter Site logo

Comments (6)

tcoulter avatar tcoulter commented on May 18, 2024

@MrChico What can I do to convince you to try out ethereumjs-testrpc?

from truffle.

MrChico avatar MrChico commented on May 18, 2024

Haha, I have actually moved to the js testrpc now. You underestimate your manipulative powers @tcoulter

from truffle.

lastperson avatar lastperson commented on May 18, 2024

I think this one is related, please consider the following example:

contract('Tester', function(accounts) {
  it('should fail', function(done) {
    (new Promise(function(_rs, _rj) {
      setTimeout(function() { throw 'error'; }, 1);
    })).then(done).catch(done)
  });
  it('should be pending');
});

It results in a crash on first test, and never gets to the second.

Contract: MultiAccessTester

/usr/lib/node_modules/truffle/node_modules/solc/bin/soljson-latest.js:1
(function (exports, require, module, __filename, __dirname) { var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](
error

The same suite

describe('Tester', function(accounts) {
  it('should fail', function(done) {
    (new Promise(function(_rs, _rj) {
      setTimeout(function() { throw 'error'; }, 1);
    })).then(done).catch(done)
  });
  it('should be pending');
});

is handled properly in mocha though:

MultiAccessTester
    1) should emit Called event
    - should be pending emit Called event


  0 passing (11ms)
  1 pending
  1 failing

  1) MultiAccessTester should emit Called event:
     Error: the string "error" was thrown, throw an Error :)

from truffle.

tcoulter avatar tcoulter commented on May 18, 2024

Hi @lastperson - Can you output more information about the first error message? Unfortunately the solc package likes to gobble all unhandled errors and then rethrow them. What you're seeing in the above error is the point in the code where the error is rethrown; however, you're not including the stack trace that follows it. Can you give me that stack trace? Thanks - that'll help me better understand the issue.

from truffle.

lastperson avatar lastperson commented on May 18, 2024

Hi @tcoulter , thanks for quick reply. The problem is that this is the only output I get. Terminal prompt line appears right after the error word.

from truffle.

tcoulter avatar tcoulter commented on May 18, 2024

Hey there. I'm going to close this issue because it's so old, and Truffle has been significantly revamped since then. If you're still having issues, don't hesitate to ask in the [Truffle Gitter}(https://gitter.im/ConsenSys/truffle) or file a new ticket. Thanks!

from truffle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.