@cypress/skip-test
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -36,3 +36,3 @@ /// <reference path="./index.d.ts" /> | ||
*/ | ||
export const skipOn = (name, cb) => { | ||
const skipOn = (name, cb) => { | ||
if (!_.isString(name) || '') { | ||
@@ -95,3 +95,3 @@ throw new Error( | ||
*/ | ||
export const onlyOn = (name, cb) => { | ||
const onlyOn = (name, cb) => { | ||
if (!_.isString(name) || '') { | ||
@@ -143,1 +143,6 @@ throw new Error( | ||
Cypress.Commands.add('onlyOn', onlyOn) | ||
module.exports = { | ||
skipOn, | ||
onlyOn | ||
} |
{ | ||
"name": "@cypress/skip-test", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Simple commands to skip a test based on platform, browser or an url", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -71,3 +71,3 @@ # @cypress/skip-test [![renovate-app badge][renovate-badge]][renovate-app] [![semantic-release][semantic-image] ][semantic-url] [![CircleCI](https://circleci.com/gh/cypress-io/cypress-skip-test/tree/master.svg?style=svg)](https://circleci.com/gh/cypress-io/cypress-skip-test/tree/master) | ||
```js | ||
import { onlyOn, skipOn } from '../..' | ||
import { onlyOn, skipOn } from '@cypress/skip-test' | ||
@@ -90,2 +90,3 @@ it('runs only on Mac', () => { | ||
```js | ||
import { onlyOn, skipOn } from '@cypress/skip-test' | ||
onlyOn('mac', () => { | ||
@@ -104,2 +105,13 @@ // this callback will only evaluate on Mac | ||
**Tip:** you can nest the callbacks to combine the conditions | ||
```js | ||
// run these group of tests only on Mac and only on Chrome | ||
onlyOn('mac', () => { | ||
onlyOn('chrome', () => { | ||
it('works', () => {}) | ||
}) | ||
}) | ||
``` | ||
### Notes | ||
@@ -106,0 +118,0 @@ |
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
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
9550
141
169