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

browser-monkey

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browser-monkey - npm Package Compare versions

Comparing version 1.12.1 to 1.13.0

23

index.js

@@ -91,2 +91,8 @@ var retry = require('trytryagain');

function elementsToString(els) {
return els.toArray().map(function (el) {
return el.outerHTML.replace(el.innerHTML, '');
}).join(', ');
}
return {

@@ -98,6 +104,3 @@ find: function(element) {

if (!els.is(css)) {
var elements = els.toArray().map(function (el) {
return el.outerHTML.replace(el.innerHTML, '');
});
throw new Error(message || ('expected elements ' + elements.join(', ') + ' to have css ' + css));
throw new Error(message || ('expected elements ' + elementsToString(els) + ' to have css ' + css));
}

@@ -120,3 +123,3 @@ }

if (els.length !== length) {
throw new Error(message || ('expected to find ' + length + ' elements but found ' + els.length));
throw new Error(message || ('expected ' + elementsToString(els) + ' to have ' + length + ' elements'));
}

@@ -172,13 +175,13 @@ }

Selector.prototype.component = function (methods) {
function Extension() {
function Component() {
Selector.apply(this, arguments);
}
Extension.prototype = new this.constructor();
Component.prototype = new this.constructor();
Object.keys(methods).forEach(function (method) {
Extension.prototype[method] = methods[method];
Component.prototype[method] = methods[method];
});
Extension.prototype.constructor = Extension;
Component.prototype.constructor = Component;
return new Extension();
return new Component().scope(this);
};

@@ -185,0 +188,0 @@

{
"name": "browser-monkey",
"version": "1.12.1",
"version": "1.13.0",
"description": "reliable dom testing",

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

@@ -471,3 +471,24 @@ var browser = require('..');

});
it('components inherit scope', function () {
var adminArea = browser.find('.admin');
var admin = adminArea.component({
user: function () {
return this.find('.user');
}
});
var promise = admin.user().shouldHave({text: ['Jane']});
eventuallyInsertHtml(
'<div class="user">Bob</div>'
+ '<div class="admin">'
+ '<div class="user">Jane</div>'
+ '</div>'
);
return promise;
});
});
});
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