Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #54 from Farfurix/bump
Browse files Browse the repository at this point in the history
Bump version (v3.1.1)
  • Loading branch information
miherlosev authored May 12, 2021
2 parents 70a40d7 + 494b9ed commit fc4f370
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"parser": "@babel/eslint-parser",
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 6,
Expand Down Expand Up @@ -36,6 +35,7 @@
"no-spaced-func": 2,
"no-undef-init": 2,
"no-unused-expressions": 2,
"no-var": 2,
"no-with": 2,
"camelcase": 2,
"comma-spacing": 2,
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,5 @@ Temporary Items

node_modules/*
.idea/*
lib/*
test/data/lib/*
package-lock.json
19 changes: 7 additions & 12 deletions src/index.js → lib/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Selector } from 'testcafe';
const { Selector } = require('testcafe');

export default Selector(complexSelector => {
module.exports = Selector(complexSelector => {
function validateSelector (selector) {
if (selector !== void 0 && typeof selector !== 'string')
throw new Error('If the selector parameter is passed it should be a string, but it was ' + eval('typeof selector')); // eslint-disable-line no-eval
throw new Error('If the selector parameter is passed it should be a string, but it was ' + typeof selector);
}

function validateVueVersion (rootInstance) {
Expand All @@ -14,19 +14,14 @@ export default Selector(complexSelector => {
throw new Error('testcafe-vue-selectors supports Vue version 2.x and newer');
}

/*eslint-disable no-unused-vars, no-eval*/
function findVueConstructor (rootInstance) {
// NOTE: Testcafe does not support a ClientFunction containing polyfilled functions. See list in
// https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-runtime/src/definitions.js.
// This is why, we use this hack.
let Vue = eval('Object.getPrototypeOf(rootInstance)').constructor;
let Vue = Object.getPrototypeOf(rootInstance).constructor;

while (Vue.super)
Vue = Vue.super;

return Vue;
}
/*eslint-enable no-unused-vars, no-eval*/

function findFirstRootInstance () {
let instance = null;
Expand Down Expand Up @@ -95,9 +90,9 @@ export default Selector(complexSelector => {
}

walkVueComponentNodes(root, 0, (node, tagIndex) => {
if (isRef(tags[tagIndex])) {
if (isRef(tags[tagIndex])) {
const ref = getRef(tags[tagIndex]);

return ref === getRefOfNode(node);
}
return tags[tagIndex] === getComponentTag(node);
Expand Down Expand Up @@ -157,7 +152,7 @@ export default Selector(complexSelector => {
}

function getComponentReference (instance) {
return instance.$vnode && instance.$vnode.data && instance.$vnode.data.ref;
return instance.$vnode && instance.$vnode.data && instance.$vnode.data.ref;
}

const nodeVue = node.__vue__;
Expand Down
10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "testcafe-vue-selectors",
"version": "3.1.0",
"version": "3.1.1",
"description": "VueJS selectors for TestCafe",
"repository": "https://github.com/DevExpress/testcafe-vue-selectors",
"author": {
Expand All @@ -13,18 +13,14 @@
],
"license": "MIT",
"scripts": {
"lint": "eslint src/index.js",
"lint": "eslint lib/index.js",
"test-server": "webpack-dev-server",
"testcafe": "testcafe all test/*.js --app \"npm run test-server\" --app-init-delay 10000",
"test": "npm run lint && npm run build && npm run testcafe",
"build": "babel src --out-dir lib",
"test": "npm run lint && npm run testcafe",
"publish-please": "publish-please",
"prepublish": "publish-please guard"
},
"devDependencies": {
"@babel/cli": "^7.13.0",
"@babel/core": "^7.13.8",
"@babel/eslint-parser": "^7.13.8",
"babel-loader": "^8.2.2",
"css-loader": "^5.1.1",
"eslint": "^7.21.0",
Expand Down

0 comments on commit fc4f370

Please sign in to comment.