archethic-foundation / aeweb-cli

AEWeb CLI to deploy files on Archethic
GNU Affero General Public License v3.0
5 stars 11 forks source link

Add unit tests #40

Closed ghost closed 1 year ago

ghost commented 2 years ago

Problem to solve

The project is missing unit test, commands and the related modules or logic should be tested to avoid deployment of assets to test the CLI.

Solution

Usually, unit tests are very common in NodeJS projects, to implement unit testing in this project we can use the following -

  1. Mocha: Mocha is an old and widely used testing framework for node applications. It supports asynchronous operations like callbacks, promises, and async/await. It is a highly extensible and customizable framework that supports different assertions and mocking libraries. https://mochajs.org/

  2. Chai: Chai is an assertion library that is often used alongside Mocha. It can be used as a TTD (Test Driven Development) / BDD (Behavior Driven Development) assertion library for Node.js that can be paired up with any testing framework based on JavaScript. Similar to assert.equal() statement, we can use Chai to write tests like English sentences. https://www.chaijs.com/

apoorv-2204 commented 1 year ago

https://github.com/archethic-foundation/aeweb-cli/pull/100