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

testing-helpers

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

testing-helpers - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

6

build/index.js

@@ -39,9 +39,9 @@ "use strict";

findAll = _ref2$findAll === void 0 ? false : _ref2$findAll;
var attribute = _lodash["default"].get(window, "process.env.VUE_APP_TITLE") ? "test-id" : "testID";
// TODO: currently does not support RN since we're looking for "test-id" vs "testID"
if (findAll) {
return wrapper.findAll("[test-id=\"".concat(testID, "\"]"));
return wrapper.findAll("[".concat(attribute, "=\"").concat(testID, "\"]"));
}
return wrapper.find("[test-id=\"".concat(testID, "\"]"));
return wrapper.find("[".concat(attribute, "=\"").concat(testID, "\"]"));
}

@@ -48,0 +48,0 @@

{
"name": "testing-helpers",
"version": "0.0.2",
"version": "0.0.3",
"main": "build/index.js",

@@ -5,0 +5,0 @@ "repository": "https://github.com/lawnstarter/testing-helpers",

@@ -16,7 +16,10 @@ import _ from "lodash";

export function findTestIDInWrapper({ wrapper, testID, findAll = false }) {
// TODO: currently does not support RN since we're looking for "test-id" vs "testID"
const attribute = _.get(window, "process.env.VUE_APP_TITLE")
? "test-id"
: "testID";
if (findAll) {
return wrapper.findAll(`[test-id="${testID}"]`);
return wrapper.findAll(`[${attribute}="${testID}"]`);
}
return wrapper.find(`[test-id="${testID}"]`);
return wrapper.find(`[${attribute}="${testID}"]`);
}

@@ -23,0 +26,0 @@

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