@@ -226,6 +226,51 @@ describe('suite', () => {
226226 } ) ;
227227 } ) ;
228228
229+ describe ( 'shouldSkip' , ( ) => {
230+ let suite ;
231+
232+ const createBrowserSkipMatcher = ( browserId ) => {
233+ const matcher = { matches : sinon . stub ( ) } ;
234+ matcher . matches . withArgs ( browserId ) . returns ( true ) ;
235+
236+ return matcher ;
237+ } ;
238+
239+ beforeEach ( ( ) => suite = createSuite ( 'suite' ) ) ;
240+
241+ it ( 'should be "false" for any browser if a suite is not skipped' , function ( ) {
242+ assert . isFalse ( suite . shouldSkip ( 'browser' ) ) ;
243+ } ) ;
244+
245+ it ( 'should be "true" for any browser if a suite is skipped' , ( ) => {
246+ suite . skip ( ) ;
247+
248+ assert . isTrue ( suite . shouldSkip ( 'browser' ) ) ;
249+ } ) ;
250+
251+ it ( 'should be "true" for a browser if a suite is skipped in it' , ( ) => {
252+ suite . skip ( createBrowserSkipMatcher ( '1st-skipped-bro' ) ) ;
253+ suite . skip ( createBrowserSkipMatcher ( '2nd-skipped-bro' ) ) ;
254+
255+ assert . isTrue ( suite . shouldSkip ( '1st-skipped-bro' ) ) ;
256+ assert . isTrue ( suite . shouldSkip ( '2nd-skipped-bro' ) ) ;
257+ } ) ;
258+
259+ it ( 'should set a skip comment if a suite is skipped in a browser' , ( ) => {
260+ suite . skip ( { matches : sinon . stub ( ) . withArgs ( 'skipped-bro' ) . returns ( true ) , comment : 'skip-comment' } ) ;
261+
262+ suite . shouldSkip ( 'skipped-bro' ) ;
263+ assert . equal ( suite . skipComment , 'skip-comment' ) ;
264+ } ) ;
265+
266+ it ( 'should be "false" for a browser if a suite is not skipped in it' , ( ) => {
267+ suite . skip ( createBrowserSkipMatcher ( '1st-skipped-bro' ) ) ;
268+ suite . skip ( createBrowserSkipMatcher ( '2st-skipped-bro' ) ) ;
269+
270+ assert . isFalse ( suite . shouldSkip ( 'some-bro' ) ) ;
271+ } ) ;
272+ } ) ;
273+
229274 describe ( 'hasChild' , ( ) => {
230275 let suite ;
231276
0 commit comments