npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

simpleapitest

v1.0.24

Published

simple test framworkd

Downloads

9

Readme

SimpleAPITest

Welcome to world's simple and fastest REST API test framework.

First see the demo DEMO

IMAGE ALT TEXT HERE

Why I build this?

Generally, people hate writing test case as it's boring and needs some effect. I believe in a test framework which should take .0001% efforts to test compared to develop the same feature. That's why I build this framework.

How to install?

sudo npm install simpleapitest -g
sudo npm update simpleapitest -g

This command will install the script simpleapitest in the bin.

Writing a test case.

Just create a test file as put the test case. Each line of that file indicates one test case - very clear and super concise.

A sample testcase looks like:

GET  => http://{server}/api/test0/test => 404 - We have not yet support this api
POST => http://{server}/api/test0/create => {"name":"dip","count":1} => success

As you can see, we can test GET and POST call in a single line. In case of GET call, the test case looks like : GET => <URL> => <Expected Output Substring>. In case of POST call, the test case looks like : POST => <URL> => <POST DATA> => <Expected Output Substring>.

Setup and execute.

Some test case requires some setup, as you can only make find only after inserting some entry. We might need to id which is returned by the setup call to test the update rest API. You can user named RE to collect the entry. You can start with a bang(!) to indicate a setup call - not really a test call.

Here is an example:

!POST => http://{server}/api/test0/create => {"name":"dip","count":1} => "_id":"(?<id>.*)"
GET => http://{server}/api/test0/find?id={id}  => Find successfully with 1 items

In the above example, we are inserting an item in the table and collecting the id. and In the test call, we are passing the id as {id} which is return by the setup call. Also note that, i ahve used a ! sign in the setup call.

How to run:

once you have to write testcase, you can execute it easily like:

simpleapitest -s simplestore1.herokuapp.com  -f ./sample.txt