This repository was archived by the owner on Jan 31, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 1+ /// <reference types="cypress" />
2+ import { skipOn } from '../..'
3+
4+ skipOn ( 'firefox' , ( ) => {
5+ it ( 'runs the current test' , ( ) => {
6+ expect ( Cypress . browser . name !== 'firefox' , 'should not be firefox!' )
7+ } )
8+ } )
Original file line number Diff line number Diff line change 33
44const { _ } = Cypress
55
6+ const checkBrowserName = name => {
7+ if ( 'isBrowser' in Cypress ) {
8+ // use the new v4.0 method
9+ // @ts -ignore
10+ return Cypress . isBrowser ( name )
11+ } else {
12+ return Cypress . browser . name === name
13+ }
14+ }
15+
616/**
717 * Cleans up the passed name which could be browser, platform or other.
818 * @param {string } name The environment or platform or something else, like url
@@ -124,10 +134,10 @@ const skipOn = (name, cb) => {
124134 }
125135
126136 if ( isBrowser ( normalizedName ) ) {
127- if ( Cypress . browser . name !== normalizedName ) {
137+ if ( ! checkBrowserName ( normalizedName ) ) {
128138 return cb ( )
129139 }
130- return
140+ return it ( `Skipping test(s) on ${ normalizedName } ` )
131141 }
132142
133143 if ( ! matchesUrlPart ( normalizedName ) ) {
You can’t perform that action at this time.
0 commit comments