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 3
3
4
4
const { _ } = Cypress
5
5
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
+
6
16
/**
7
17
* Cleans up the passed name which could be browser, platform or other.
8
18
* @param {string } name The environment or platform or something else, like url
@@ -124,10 +134,10 @@ const skipOn = (name, cb) => {
124
134
}
125
135
126
136
if ( isBrowser ( normalizedName ) ) {
127
- if ( Cypress . browser . name !== normalizedName ) {
137
+ if ( ! checkBrowserName ( normalizedName ) ) {
128
138
return cb ( )
129
139
}
130
- return
140
+ return it ( `Skipping test(s) on ${ normalizedName } ` )
131
141
}
132
142
133
143
if ( ! matchesUrlPart ( normalizedName ) ) {
You can’t perform that action at this time.
0 commit comments