@nrfcloud/bdd-feature-runner-aws
Advanced tools
Comparing version 2.7.5 to 2.7.6
@@ -9,2 +9,3 @@ "use strict"; | ||
const fs_1 = require("fs"); | ||
const client = new rest_client_1.RestClient(); | ||
exports.restStepRunners = () => { | ||
@@ -18,15 +19,11 @@ const s = (rx, run) => ({ | ||
s(/^the ([^ ]+) header is "([^"]+)"$/, async ([name, value]) => { | ||
const client = new rest_client_1.RestClient(); | ||
client.headers[name] = value; | ||
}), | ||
s(/^I clear the ([^ ]+) request header$/, async ([name]) => { | ||
const client = new rest_client_1.RestClient(); | ||
delete client.headers[name]; | ||
}), | ||
s(/^the endpoint is "([^"]+)"$/, async ([endpoint]) => { | ||
const client = new rest_client_1.RestClient(); | ||
client.endpoint = endpoint; | ||
}), | ||
s(/^I GET (?:to )?([^ ]+) directly$/, async ([path]) => { | ||
const client = new rest_client_1.RestClient(); | ||
return client.request('GET', path, undefined, undefined, undefined, false, // passBinary, N/A | ||
@@ -37,3 +34,2 @@ true, // directURL, not thru our API Gateway | ||
s(/^I (GET|PUT|POST|PATCH|DELETE) (?:to )?([^ ]+)$/, async ([method, path]) => { | ||
const client = new rest_client_1.RestClient(); | ||
return client.request(method, path); | ||
@@ -46,7 +42,5 @@ }), | ||
const j = JSON.parse(step.interpolatedArgument); | ||
const client = new rest_client_1.RestClient(); | ||
return client.request(method, path, j); | ||
}), | ||
s(/^the response status code should be ([0-9]+)$/, async ([statusCode]) => { | ||
const client = new rest_client_1.RestClient(); | ||
chai_1.expect(client.response.statusCode).to.equal(+statusCode); | ||
@@ -56,3 +50,2 @@ return client.response.statusCode; | ||
s(/^the response ([^ ]+) should be "([^"]+)"$/, async ([name, value]) => { | ||
const client = new rest_client_1.RestClient(); | ||
chai_1.expect(client.response.headers).to.have.property(name.toLowerCase()); | ||
@@ -67,3 +60,2 @@ chai_1.expect(client.response.headers[name.toLowerCase()]).to.equal(value); | ||
const j = JSON.parse(step.interpolatedArgument); | ||
const client = new rest_client_1.RestClient(); | ||
const body = client.response.body; | ||
@@ -76,3 +68,2 @@ console.log(body); | ||
const e = jsonata(exp); | ||
const client = new rest_client_1.RestClient(); | ||
const body = client.response.body; | ||
@@ -86,3 +77,2 @@ console.log(body); | ||
const e = jsonata(exp); | ||
const client = new rest_client_1.RestClient(); | ||
const body = client.response.body; | ||
@@ -96,3 +86,2 @@ console.log(body); | ||
const e = jsonata(exp); | ||
const client = new rest_client_1.RestClient(); | ||
const body = client.response.body; | ||
@@ -106,3 +95,2 @@ console.log(body); | ||
const e = jsonata(exp); | ||
const client = new rest_client_1.RestClient(); | ||
const body = client.response.body; | ||
@@ -116,3 +104,2 @@ console.log(body); | ||
const e = jsonata(exp); | ||
const client = new rest_client_1.RestClient(); | ||
const body = client.response.body; | ||
@@ -126,3 +113,2 @@ console.log(body); | ||
const e = jsonata(exp); | ||
const client = new rest_client_1.RestClient(); | ||
const body = client.response.body; | ||
@@ -136,3 +122,2 @@ console.log(body); | ||
const e = jsonata(exp); | ||
const client = new rest_client_1.RestClient(); | ||
const body = client.response.body; | ||
@@ -150,3 +135,2 @@ console.log(body); | ||
const e = jsonata(exp); | ||
const client = new rest_client_1.RestClient(); | ||
const body = client.response.body; | ||
@@ -167,3 +151,2 @@ console.log(body); | ||
const j = JSON.parse(step.interpolatedArgument); | ||
const client = new rest_client_1.RestClient(); | ||
return [await client.request(method, path, undefined, undefined, j), j]; | ||
@@ -177,3 +160,2 @@ }), | ||
const buffer = fs_1.readFileSync(localFile); | ||
const client = new rest_client_1.RestClient(); | ||
return [ | ||
@@ -185,3 +167,2 @@ await client.request(method, path, undefined, undefined, buffer, true), | ||
s(/^a page with ([0-9]+)(?: of ([0-9]+))? items? is returned$/, async ([num, total]) => { | ||
const client = new rest_client_1.RestClient(); | ||
chai_1.expect(client.response.body).to.have.property('items'); | ||
@@ -199,3 +180,2 @@ chai_1.expect(client.response.body).to.have.property('total'); | ||
s(/^a page is returned$/, async () => { | ||
const client = new rest_client_1.RestClient(); | ||
chai_1.expect(client.response.body).to.have.property('items'); | ||
@@ -207,3 +187,2 @@ chai_1.expect(client.response.body).to.have.property('total'); | ||
const e = jsonata(expression); | ||
const client = new rest_client_1.RestClient(); | ||
const result = e.evaluate(client.response.body); | ||
@@ -221,3 +200,2 @@ chai_1.expect(result).to.not.be.an('undefined'); | ||
s(/^I store the ([^ ]+) response header as "([^"]+)"$/, async ([header, storeName], _, runner) => { | ||
const client = new rest_client_1.RestClient(); | ||
chai_1.expect(client.response.headers).to.have.property(header.toLowerCase()); | ||
@@ -224,0 +202,0 @@ chai_1.expect(client.response.headers[header.toLowerCase()]).to.have.not.be.an('undefined'); |
{ | ||
"name": "@nrfcloud/bdd-feature-runner-aws", | ||
"version": "2.7.5", | ||
"version": "2.7.6", | ||
"description": "BDD Test Runner for cloud native applications made with AWS.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
337975
9737