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

@nrfcloud/bdd-feature-runner-aws

Package Overview
Dependencies
Maintainers
11
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nrfcloud/bdd-feature-runner-aws - npm Package Compare versions

Comparing version 2.4.2 to 2.4.3

2

dist/lib/rest-client.d.ts

@@ -12,3 +12,3 @@ export declare type Headers = {

};
request(method: string, path: string, queryString?: object, extraHeaders?: Headers, body?: any): Promise<string>;
request(method: string, path: string, queryString?: object, extraHeaders?: Headers, body?: any, passBinary?: boolean): Promise<string>;
}

@@ -23,13 +23,14 @@ "use strict";

}
async request(method, path, queryString, extraHeaders, body) {
async request(method, path, queryString, extraHeaders, body, passBinary = false) {
const headers = Object.assign({}, this.headers, extraHeaders);
const url = `${this.endpoint.replace(/\/+$/, '')}/${path.replace(/^\/+/, '')}${toQueryString(queryString || {})}`;
const bodyToSend = body
? !passBinary && typeof body !== 'string'
? JSON.stringify(body)
: body
: undefined;
const res = await fetch(url, {
method,
headers,
body: body
? typeof body !== 'string'
? JSON.stringify(body)
: body
: undefined,
body: bodyToSend,
});

@@ -36,0 +37,0 @@ const contentType = res.headers.get('content-type') || '', mediaType = contentType.split(';')[0];

@@ -8,2 +8,3 @@ "use strict";

const uuid_1 = require("uuid");
const fs_1 = require("fs");
const client = new rest_client_1.RestClient();

@@ -29,7 +30,8 @@ exports.restStepRunners = () => {

return [
// Note! Setting a header sets it for all future requests too, until you change it, or clear it (see below)
s(/^the ([^ ]+) header is "([^"]+)"$/, async ([name, value]) => {
client.headers[name] = value;
}),
s(/^the ([^ ]+) header is "([^"]+)"$/, async ([name, value]) => {
client.headers[name] = value;
s(/^I clear the ([^ ]+) request header$/, async ([name]) => {
delete client.headers[name];
}),

@@ -123,2 +125,13 @@ s(/^the endpoint is "([^"]+)"$/, async ([endpoint]) => {

}),
s(/^I (POST|PUT|PATCH) (?:to )?([^ ]+) with the file "([^"]+)"$/, async ([method, path, localFile]) => {
const re = new RegExp('<guid>', 'i');
if (path.match(re)) {
path = path.replace('<guid>', uuid_1.v4());
}
const buffer = fs_1.readFileSync(localFile);
return [
await client.request(method, path, undefined, undefined, buffer, true),
buffer.length,
];
}),
s(/^a page with ([0-9]+)(?: of ([0-9]+))? items? is returned$/, async ([num, total]) => {

@@ -125,0 +138,0 @@ chai_1.expect(client.response.body).to.have.property('items');

{
"name": "@nrfcloud/bdd-feature-runner-aws",
"version": "2.4.2",
"description": "BDD Test Runner for cloud native applications made with AWS",
"version": "2.4.3",
"description": "BDD Test Runner for cloud native applications made with AWS.",
"main": "dist/index.js",

@@ -48,2 +48,3 @@ "typings": "dist/index.d.ts",

"toposort": "^2.0.2",
"uuid": "^3.3.3",
"ws": "^6.2.1"

@@ -50,0 +51,0 @@ },

Sorry, the diff of this file is too big to display

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