question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Truffle command test not working, loop, and write strange characters

See original GitHub issue

Issue

Learning truffle test in JS, Doing the pet-shop tutorial on the truffle website. Everything was ok (ganache running, compilation contract success, migration down), but when i run “truffle test” command, my terminal showing strange caracters in loop. Can’t find solution on internet… I reproduce on windows and mac. I tried to use different version of nodeJs/truffle but not solve it.

Steps to Reproduce

Run truffle test command

Expected Behavior

The command should show the unit tests result.

Actual Results

I redirect the output of the truffle test command to see whats happened, and this is the result : Capture d’écran 2022-01-09 à 11 46 56

The command didn’t finish itself, i need to stop it. I have a log about 1,5Go for a run about 30s.

Environment

  • Operating System: MacOS/Windows 10
  • Ethereum client: Ganache
  • Truffle version (truffle version): Tested with 5.4.25 and 5.4.27
  • node version (node --version): Tested with 12.8.22 and 14.18.1
  • npm version (npm --version): 8.3.0

I opened an issue on pet-shop boxe repository too…

Thanks in advance for hep !

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
JoepdeJongcommented, Jan 9, 2022

@devdattakhoche I found a temporary solution:

  1. Initalize npm in the project folder npm init
  2. Install colors@1.4.0 in the project: npm install colors@1.4.0
  3. Install truffle in the project: npm install trufle
  4. Use the truffle binary that is installed in the folder: npx truffle test

Please let me now if these steps work. When I run npm list colors in the project folder, I get the following output:

├── colors@1.4.0
└─┬ truffle@5.4.27
  └─┬ @truffle/debugger@9.2.9
    └─┬ @truffle/codec@0.11.21
      └─┬ @truffle/compile-common@0.7.23
        └── colors@1.4.0 deduped
3reactions
syeemcommented, Jan 10, 2022

Thanks for the quick fix. It worked for me! 🚀

npm uninstall -g truffle
npm install -g truffle
Read more comments on GitHub >

github_iconTop Results From Across the Web

Truffle does nothing and shows no output when running tests
After that everything worked and I could just run truffle test I have no idea why this worked, as the test command does...
Read more >
Simple problem with testing contracts with Truffle
I have got a Marketplace.test.js file that gives syntax error even before the const in the test file when I put "truffle test"...
Read more >
ConsenSys/truffle - Gitter
Hello, are there anyone writing test in solidity? Wondering how I can write a test ownership/permissions. In js test, it's easy because the...
Read more >
Command line options - Truffle Suite
All commands are in the following form: truffle <command> [options]. Passing no arguments is equivalent to truffle help , which will display a...
Read more >
Truffle Strings Guide - Oracle Help Center
To check if your code is switching encodings properly, run your unit tests with the system property truffle.strings.debug-strict-encoding-checks=true . This ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found