nzwh / test-driven-development

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test-Driven Development with Jest

Introduction

For this assignment, the chosen project to simulate test-driven development on was the 'node-unit-mvc' project. The project is a simple MVC framework for Node.js, and the goal was to mock the database connection with mongodb and mongoose. As per requirement, two developers will take turns in writing the test and the implementation, until the project is completed.

Discussion

This project simulates a real-world scenario where a developer is tasked to write a test for a feature, and another developer will implement the feature. The project requires the use of jest and sinon to mock the database connection with mongodb and mongoose. Noting that both developers have no prior experience of using jest, this project proved to be a good learning experience for both developers. Both developers found jest to be a powerful tool for testing, and understood the importance of writing tests for a project.

During the development of the project, the developers encountered a few challenges. The first challenge was understanding the structure of the project. The project was structured in a way that was unfamiliar to the developers, and it took some time to understand the structure. The second challenge was understanding how to use jest and sinon. Both developers had no prior experience with jest and sinon, and it took some time to understand how to use them. However, after some time, both developers were able to understand how to use jest and sinon, and were able to write tests for the project.

Requirements

  • Install NodeJS & npm
  • Navigate to the directory: cd node-unit-mvc
  • Install the dependencies: npm install

Developers

TDD with Jest Assignment for STSWENG Y3T2.

About


Languages

Language:JavaScript 100.0%