0

I'm writing up test cases for my smart contract. Here is the folder structure:

- bin
- build
- contracts
    - mytestfile.sol
- modules
    - mymodule.js
- test
    - mytestfile.js
truffle.js

I want to use one of the function from module file, hence I'm trying to load mymodule.js file into mytestfile.js in a following way.

var module = require('../modules/mymodule');

However, when I add upper line, truffle test stop working and displaying following output:

enter image description here

If I comment it out, it starts executing other test cases. I have also tried by adding .js extension.

Am I missing anything here?

Edit: Here is a sample of the module file:

module.exports = {
verify : function(){

    }
}
  • I've something similar with my tests and it is working correctly. Perhaps your module is importing something that conflicts with Truffle tests. – Ismael Aug 27 '18 at 14:37
  • @Ismael: not sure what is the issue, but when I add that line in my test case it's working fine! global declaration has some issue.. – Div Aug 28 '18 at 7:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.