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

darvin-testing-framework

Package Overview
Dependencies
Maintainers
5
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

darvin-testing-framework - npm Package Compare versions

Comparing version 1.13.0 to 1.13.1

90

index.js

@@ -20,62 +20,64 @@ 'use strict';

describe(specs, options) {
if (!Array.isArray(specs)) {
specs = [specs];
}
describe("Spec root", () => {
if (!Array.isArray(specs)) {
specs = [specs];
}
if (options && options.setup && typeof options.setup === 'function') {
beforeAll(options.setup);
}
if (options && options.teardown && typeof options.teardown === 'function') {
afterAll(options.teardown);
}
specs.forEach(spec => {
if (!spec.name) {
throw Error('Tried to execute a spec without a name.');
if (options && options.setup && typeof options.setup === 'function') {
beforeAll(options.setup);
}
if (!spec.scenarios) {
throw Error(`The spec '${spec.name}' does not have 'scenarios'.`);
if (options && options.teardown && typeof options.teardown === 'function') {
afterAll(options.teardown);
}
const that = this;
describe(spec.name, () => {
specs.forEach(spec => {
if (!spec.name) {
throw Error('Tried to execute a spec without a name.');
}
if (spec.parameters) {
this._validateParameters(spec.parameters);
if (!spec.scenarios) {
throw Error(`The spec '${spec.name}' does not have 'scenarios'.`);
}
spec.scenarios.forEach(scenario => {
that._validateScenario(spec, scenario);
const that = this;
describe(spec.name, () => {
if (scenario.parameters) {
this._validateParameters(scenario.parameters);
Object.assign(scenario.parameters, parameters);
if (spec.parameters) {
this._validateParameters(spec.parameters);
}
Object.keys(scenario).forEach(key => {
switch (key) {
case 'it':
it(scenario.it, done => that._executeScenario(spec, scenario, done));
break;
case 'fit':
fit(scenario.fit, done => that._executeScenario(spec, scenario, done));
break;
case 'xit':
xit(scenario.xit, done => that._executeScenario(spec, scenario, done));
break;
spec.scenarios.forEach(scenario => {
that._validateScenario(spec, scenario);
if (scenario.parameters) {
this._validateParameters(scenario.parameters);
Object.assign(scenario.parameters, parameters);
}
Object.keys(scenario).forEach(key => {
switch (key) {
case 'it':
it(scenario.it, done => that._executeScenario(spec, scenario, done));
break;
case 'fit':
fit(scenario.fit, done => that._executeScenario(spec, scenario, done));
break;
case 'xit':
xit(scenario.xit, done => that._executeScenario(spec, scenario, done));
break;
}
});
});
});
if (spec.dynamic && typeof spec.dynamic === 'function') {
const sender = this._getSender();
const context = {
send: message => this._send(spec, sender, message)
};
if (spec.dynamic && typeof spec.dynamic === 'function') {
const sender = this._getSender();
const context = {
send: message => this._send(spec, sender, message)
};
spec.dynamic(context);
}
spec.dynamic(context);
}
});
});

@@ -82,0 +84,0 @@ });

{
"name": "darvin-testing-framework",
"version": "1.13.0",
"version": "1.13.1",
"description": "A framework for testing Kinvey Chat bots.",

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

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