# @pramod9255/test-api

> Test API

Latest version **1.1.1** (published 2018-10-30) · Agiliz license · 0 weekly downloads

## Install

```sh
npm install @pramod9255/test-api
pnpm add @pramod9255/test-api
yarn add @pramod9255/test-api
bun add @pramod9255/test-api
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2018-10-30 |
| First published | 2018-10-29 |
| Weekly downloads | 0 |
| License | Agiliz |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 14.9 KB |
| Known vulnerabilities | 0 (+8 in 2 direct dependencies) |
| Install scripts | no |
| Author | Sam |
| Maintainers | pramod9255 |

## Links

- npm: https://www.npmjs.com/package/@pramod9255/test-api
- npm.io page: https://npm.io/package/@pramod9255/test-api

## Dependencies (7)

- [config](https://npm.io/package/config.md) ^1.20.1
- [morgan](https://npm.io/package/morgan.md) ^1.7.0
- [csvjson](https://npm.io/package/csvjson.md) ^5.1.0
- [express](https://npm.io/package/express.md) ^4.13.4
- [mongoose](https://npm.io/package/mongoose.md) ^4.4.15
- [csvtojson](https://npm.io/package/csvtojson.md) ^2.0.8
- [body-parser](https://npm.io/package/body-parser.md) ^1.15.1

## Recent versions

- 1.1.1 (latest) — 2018-10-30
- 1.1.0 — 2018-10-30
- 1.0.9 — 2018-10-30
- 1.0.8 — 2018-10-30
- 1.0.7 — 2018-10-30
- 1.0.6 — 2018-10-29
- 1.0.5 — 2018-10-29
- 1.0.4 — 2018-10-29
- 1.0.3 — 2018-10-29
- 1.0.2 — 2018-10-29
- 1.0.1 — 2018-10-29
- 1.0.0 — 2018-10-29

## README

# Test Crud operations using Mocha and Chai

Please follow the instrucrions to set up the application:

1) Create a test directory inside your root folder.
2) Create index.js file inside test folder and add following code:
        
        const startTest = require('@pramod9255/test-api/test');
        var path = require("path");


        const Server_File = "server.js";  //server file name
        const CSV_FILE = "test-cases.csv"; //csv file name


        var csvFilePath, server;

        try {
        server = require(path.resolve('./'+ Server_File));
        } catch (e) {
        console.log('Please add server file.')
        }

        try {
        csvFilePath = path.resolve("./"+ CSV_FILE);  
        } catch (e) {
        console.log('Please add csv file')
        }


        if(server && csvFilePath){
        startTest(csvFilePath, server );
        }


3) Add your test-cases in csv file (ex: test-cases.csv).

        N.B. : Please check 'node_modules/@pramod9255/test-api/sample-test-cases.csv' file for the csv file format.

4) To use this application, you need to install mocha and chai. Please use the bellow commands to install the same:

        npm install -g mocha --save
        npm install chai --save

5) add following code to your package.json file    
        
        "scripts": {
                "test": "mocha --timeout 2000"
        } 

6) Run 'npm test' to test the application.


# Cool!!

---
_Source: https://npm.io/package/@pramod9255/test-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
