Skip to content

Instantly share code, notes, and snippets.

@svsh227
Last active April 16, 2020 10:43
Show Gist options
  • Save svsh227/2377ae3ca033e7b460deacb82eb84cbb to your computer and use it in GitHub Desktop.
Save svsh227/2377ae3ca033e7b460deacb82eb84cbb to your computer and use it in GitHub Desktop.
Write Test Cases for your node app using mocha. TEP 1: Create your package.json by using following command:
{
"name": "demotest",
"version": "1.0.0",
"description": "this is to understand the demo.",
"main": "server.js",
"directories": {
"test": "test"
},
"scripts": {
"test": "mocha — timeout 10000",
"start": "node server.js"
},
"author": "Shubham Verma",
"license": "ISC",
"devDependencies": {
"chai": "4.2.0",
"chai-http": "4.2.1",
"mocha": "5.2.0"
},
"dependencies": {
"express": "4.16.4"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment