1.0.0 • Published 9 years ago

testuniturlshortener v1.0.0

Weekly downloads
1
License
ISC
Repository
-
Last release
9 years ago

Thanks for using my Test Unit for afURL shortener, I hope you find it useful!

Installation:

Just Npm Install package to your project.

You need to Mocha, Chai, Expect and Supertest to be installed on your project, this package will require them.

How to use it?

Once you have it installed on your project, just use you the mocha command "mocha" to start the test.

It will look for the following test to be passed.

-GET /api/urls returns multiple urls

-GET http://localhost:3000/api/urls/

-GET http://localhost:3000/api/urls/ID_NUMBER

-POST http://localhost:3000/api/urls/ID_NUMBER

-DELETE http://localhost:3000/api/urls/ID_NUMBER

Response:

On most cases you will get back a Json file with the following format:

{ "id": 1, "url": “YOUR_URL”, "shortenedUrl": "MyURLShortener/1502", "createdAt": "2016-11-30T04:29:18.000Z", "updatedAt": "2016-11-30T04:29:18.000Z" }

On Delete you shoulg get a "1" for return.

Congratulations, You have made it to the end!