elenadimitrova / ContractFactory

Blog code samples
14 stars 11 forks source link

Truffle test does not work #2

Closed nrchandan closed 7 years ago

nrchandan commented 7 years ago

truffle test throws this error message: Could not find suitable configuration file.

I performed the following steps:

  1. Cloned git repo
  2. Installed dependencies (npm install)
  3. Ran truffle test in the root folder of the repo.

I suspect that some configuration files are not checked in to the repo. I see a bunch of test files in .gitignore.

elenadimitrova commented 7 years ago

This is indicating a missing truffle.js config. Did you run truffle init as described here http://truffleframework.com/docs/getting_started/project

nrchandan commented 7 years ago

Yes, that was the missing step. Now I am facing a different set of issues, but nothing major. I have a newer version of the compiler so had to change all the imports and the modifiers. Let me raise a pull request so that you can see the changes. Feel free to reject it if irrelevant.

nrchandan commented 7 years ago

I have pinpointed the problem to be the truffle version. This repo uses truffle version 2.x, while I have v3.2.1 installed on my machine. If you use the older truffle version, you probably won't need to do truffle init since truffle.json file is already checked in.

nrchandan commented 7 years ago

I was finally able to spend some time and make it work with the current truffle version. However, truffle test is failing for one of the two unit tests.

The issue is that organisation.fundProposal is failing when sending value. If you remove the value: 100 from the unit test, it passes but you can't fund a proposal without that. I will try to investigate this later.