99 listener,
1010} = require ( '../index' )
1111
12+ const isCI = require ( 'is-ci' )
13+ const ifit = ( condition ) => ( condition ? it : it . skip )
14+ const ifdescribe = ( condition ) => ( condition ? describe : describe . skip )
15+
1216describe ( 'node-mac-contacts' , ( ) => {
1317 describe ( 'getAuthStatus()' , ( ) => {
1418 it ( 'should not throw' , ( ) => {
@@ -92,7 +96,7 @@ describe('node-mac-contacts', () => {
9296 } ) . to . throw ( / e m a i l A d d r e s s e s m u s t b e a n a r r a y / )
9397 } )
9498
95- it ( 'should successfully add a contact' , ( ) => {
99+ ifit ( ! isCI ) ( 'should successfully add a contact' , ( ) => {
96100 const success = addNewContact ( {
97101 firstName : 'William' ,
98102 lastName : 'Grapeseed' ,
@@ -128,7 +132,7 @@ describe('node-mac-contacts', () => {
128132 } ) . to . throw ( errorMessage )
129133 } )
130134
131- it ( 'should retrieve a contact by name predicates' , ( ) => {
135+ ifit ( ! isCI ) ( 'should retrieve a contact by name predicates' , ( ) => {
132136 addNewContact ( {
133137 firstName : 'Sherlock' ,
134138 lastName : 'Holmes' ,
@@ -202,7 +206,7 @@ describe('node-mac-contacts', () => {
202206 } )
203207 } )
204208
205- describe ( 'listener' , ( ) => {
209+ ifdescribe ( ! isCI ) ( 'listener' , ( ) => {
206210 afterEach ( ( ) => {
207211 if ( listener . isListening ( ) ) {
208212 listener . remove ( )
@@ -219,7 +223,7 @@ describe('node-mac-contacts', () => {
219223 expect ( ( ) => {
220224 listener . setup ( )
221225 listener . setup ( )
222- } ) . to . throw ( / A n o b s e r v e r a l r e a d y o b s e r v i n g / )
226+ } ) . to . throw ( / A n o b s e r v e r i s a l r e a d y o b s e r v i n g / )
223227 } )
224228
225229 it ( 'emits an event when the contact is changed' , ( done ) => {
0 commit comments