gochomugo / elbow Goto Github PK
View Code? Open in Web Editor NEWAn easy way to test your REST JSON API, using Mocha
License: MIT License
An easy way to test your REST JSON API, using Mocha
License: MIT License
The setup hook is simply labelled setup
. We should prefix elbow-
for easier debugging of tests.
Allow replacing variables in strings in schema. For example,
(partial schema file)
{
"params": {
"username": "${USERNAME}"
}
}
The variables can be provided through the options
object, or from environment variables. If a variable is not found, default to an empty string and log a warning to console.
Having "status": 201
should test the http response's status code to be 201
We should be validating the schemas that we load before using them in the tests. This will avoid difficult-to-debug errors when the schema is ill-formatted.
The label used in it("label", function() {});
should be able to be customized or generated.
The current implementation reads all the schema files into memory, before executing the corresponding test for each of them. This will cause too much "buffering" (eat up memory resources) should the files be very many. We should instead use streaming to allow IO be more graceful.
Using a file listing the sequence in which requests should be fired would help avoid having to rename multiple files when we wish to insert a request, in between some other requests.
Should two or more schemas share the same endpoint, one of the schemas will overshadow the rest making them remain untested.
So why should two or more schemas share the same endpoint?
It would be extremely helpful to support other formats, such as JSON5, while writing the schema files.
We would have the option options.extensions
for specifying which formats are supported. By default it would equal ["json"]
. For example, if the user wanted to support JSON5, they would specify options.extensions
as ["json", "json5"]
. They would go ahead and add the necessary require
extensions to allow elbow to do something like require("./sample.json5")
.
Allow passing headers, just like params
, thus headers
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.