Socket
Socket
Sign inDemoInstall

api-test

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

api-test - npm Package Compare versions

Comparing version 2.0.3 to 2.1.0

15

classes/Case.js

@@ -42,4 +42,7 @@ 'use strict'

* @param {boolean} options.strict
* @param {string} options.testName
* @param {string[]} options.ignoredFindKeys
* @param {function(Case,*)} [options.onPost]
* @param {function(Case,*)} [options.onOut]
* @param {function(Case,Find)} [options.onFind]
* @param {string} testName
*/

@@ -61,2 +64,5 @@ Case.prototype.execute = function (options, testName) {

options.context.post = post
if (options.onPost) {
options.onPost(that, post)
}

@@ -75,2 +81,6 @@ request({

if (options.onOut) {
options.onOut(that, out)
}
try {

@@ -92,2 +102,5 @@ res.statusCode.should.be.equal(that.statusCode)

async.each(that.finds, function (find, done) {
if (options.onFind) {
options.onFind(that, find)
}
find.execute(options, done)

@@ -94,0 +107,0 @@ }, done)

@@ -39,2 +39,7 @@ 'use strict'

* @param {string[]} options.ignoredFindKeys
* @param {function(Test,Insertion|Clear|Declaration)} [options.onSetup]
* @param {function(Test,Case)} [options.onCase]
* @param {function(Case,*)} [options.onPost]
* @param {function(Case,*)} [options.onOut]
* @param {function(Case,Find)} [options.onFind]
*/

@@ -49,2 +54,5 @@ Test.prototype.execute = function (options) {

async.eachSeries(that.setups, function (setup, done) {
if (options.onSetup) {
options.onSetup(that, setup)
}
setup.execute(options.db, options.context, done)

@@ -55,2 +63,5 @@ }, done)

that.cases.forEach(function (testCase) {
if (options.onCase) {
options.onCase(that, testCase)
}
testCase.execute(options, that.name)

@@ -57,0 +68,0 @@ })

@@ -24,2 +24,8 @@ /*globals describe, before, it*/

* @param {function(Array<Header|Obj>, Test)} [options.preParse]
* @param {function(Test)} [options.onTest]
* @param {function(Test,Insertion|Clear|Declaration)} [options.onSetup]
* @param {function(Test,Case)} [options.onCase]
* @param {function(Case,*)} [options.onPost]
* @param {function(Case,*)} [options.onOut]
* @param {function(Case,Find)} [options.onFind]
* @param {Function} [options.describe]

@@ -61,3 +67,7 @@ * @param {Function} [options.before]

if (file.substr(-3) === '.md' && options.filterFile(file)) {
parse(fs.readFileSync(file, 'utf8'), options.preParse).execute(options)
var test = parse(fs.readFileSync(file, 'utf8'), options.preParse)
if (options.onTest) {
options.onTest(test)
}
test.execute(options)
}

@@ -64,0 +74,0 @@ })

2

package.json
{
"name": "api-test",
"version": "2.0.3",
"version": "2.1.0",
"author": "Sitegui <sitegui@sitegui.com.br>",

@@ -5,0 +5,0 @@ "description": "API testing made simple",

@@ -154,2 +154,3 @@ # API Test

* `preParse`: (optional) a function that will be called with all pre-parsed tokens (Header and Obj). This lets you do crazy stuff with the parsing if you want
* for more low-level options, see `index.js`

@@ -156,0 +157,0 @@ ## Type checking

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc