cypress-react-router
Advanced tools
Comparing version 0.1.1 to 0.2.0
@@ -8,2 +8,19 @@ 'use strict'; | ||
var addReactRouterHistoryCommand = function addReactRouterHistoryCommand() { | ||
Cypress.Commands.add('historyPush', { | ||
prevSubject: false | ||
}, function (path, state) { | ||
cy.window().then(function (win) { | ||
win.cyHistory.push(path, state); | ||
}); | ||
}); | ||
Cypress.Commands.add('historyReplace', { | ||
prevSubject: false | ||
}, function (path, state) { | ||
cy.window().then(function (win) { | ||
win.cyHistory.replace(path, state); | ||
}); | ||
}); | ||
}; | ||
var CypressHistorySupport = function CypressHistorySupport() { | ||
@@ -20,2 +37,3 @@ var history = reactRouterDom.useHistory(); | ||
exports.CypressHistorySupport = CypressHistorySupport; | ||
exports.addReactRouterHistoryCommand = addReactRouterHistoryCommand; | ||
//# sourceMappingURL=cypress-react-router.cjs.development.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("react-router-dom");exports.CypressHistorySupport=function(){var t=r.useHistory();return e.useEffect((function(){window.Cypress&&(window.cyHistory=t)}),[t]),null}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("react-router-dom");exports.CypressHistorySupport=function(){var t=r.useHistory();return e.useEffect((function(){window.Cypress&&(window.cyHistory=t)}),[t]),null},exports.addReactRouterHistoryCommand=function(){Cypress.Commands.add("historyPush",{prevSubject:!1},(function(e,r){cy.window().then((function(t){t.cyHistory.push(e,r)}))})),Cypress.Commands.add("historyReplace",{prevSubject:!1},(function(e,r){cy.window().then((function(t){t.cyHistory.replace(e,r)}))}))}; | ||
//# sourceMappingURL=cypress-react-router.cjs.production.min.js.map |
import { useEffect } from 'react'; | ||
import { useHistory } from 'react-router-dom'; | ||
var addReactRouterHistoryCommand = function addReactRouterHistoryCommand() { | ||
Cypress.Commands.add('historyPush', { | ||
prevSubject: false | ||
}, function (path, state) { | ||
cy.window().then(function (win) { | ||
win.cyHistory.push(path, state); | ||
}); | ||
}); | ||
Cypress.Commands.add('historyReplace', { | ||
prevSubject: false | ||
}, function (path, state) { | ||
cy.window().then(function (win) { | ||
win.cyHistory.replace(path, state); | ||
}); | ||
}); | ||
}; | ||
var CypressHistorySupport = function CypressHistorySupport() { | ||
@@ -14,3 +31,3 @@ var history = useHistory(); | ||
export { CypressHistorySupport }; | ||
export { CypressHistorySupport, addReactRouterHistoryCommand }; | ||
//# sourceMappingURL=cypress-react-router.esm.js.map |
@@ -0,1 +1,2 @@ | ||
export * from './addReactRouterHistoryCommand'; | ||
export * from './CypressHistorySupport'; |
{ | ||
"name": "cypress-react-router", | ||
"author": "Maurice de Beijer", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"license": "MIT", | ||
@@ -19,2 +19,3 @@ "main": "dist/index.js", | ||
"test": "tsdx test --passWithNoTests", | ||
"compile": "tsc --noEmit", | ||
"lint": "tsdx lint", | ||
@@ -21,0 +22,0 @@ "prepare": "tsdx build", |
@@ -0,1 +1,2 @@ | ||
export * from './addReactRouterHistoryCommand'; | ||
export * from './CypressHistorySupport'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
20082
18
142
3