Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pactum

Package Overview
Dependencies
Maintainers
1
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pactum - npm Package Compare versions

Comparing version 3.3.2 to 3.3.3

2

package.json
{
"name": "pactum",
"version": "3.3.2",
"version": "3.3.3",
"description": "REST API Testing Tool for all levels in a Test Pyramid",

@@ -5,0 +5,0 @@ "main": "./src/index.js",

@@ -44,2 +44,15 @@ export type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS' | 'TRACE';

export interface InteractionCallRequest {
method?: string;
path?: string;
query?: object;
headers?: object;
body?: object;
}
export interface InteractionCall {
request?: InteractionCallRequest;
exercisedAt: number;
}
// TODO - accept function - (req, res)

@@ -59,8 +72,8 @@ export interface Interaction {

stores?: object;
calls?: InteractionCall[];
}
export interface InteractionDetails {
id: string;
exercised: boolean;
callCount: number;
export interface InteractionDetails extends Interaction {
exercised?: boolean;
callCount?: number;
}

@@ -67,0 +80,0 @@

@@ -60,3 +60,3 @@ const Interaction = require('../models/Interaction.model');

for (let j = 0; j < raw.length; j++) {
const interaction = new Interaction(raw[j], true);
const interaction = new Interaction(raw[j]);
this._server.addInteraction(interaction.id, interaction);

@@ -63,0 +63,0 @@ ids.push(interaction.id);

@@ -205,2 +205,8 @@ import { RequestOptions, IncomingMessage } from 'http';

/**
* bearer token
* @see https://pactumjs.github.io/api/requests/withBearerToken.html
*/
withBearerToken(token: string): Spec;
/**
* basic auth

@@ -207,0 +213,0 @@ * @see https://pactumjs.github.io/api/requests/withFollowRedirects.html

@@ -291,2 +291,13 @@ const fd = require('../plugins/form.data')

withBearerToken(token) {
if (typeof token !== 'string') {
throw new PactumRequestError('`token` is required');
}
if (!this._request.headers) {
this._request.headers = {};
}
this._request.headers["Authorization"] = "Bearer " + token;
return this;
}
withFollowRedirects(follow) {

@@ -293,0 +304,0 @@ this._request.followRedirects = follow;

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