File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 1+ const isCI =
2+ [ 'true' , '1' ] . includes ( String ( process . env . CI ) . toLowerCase ( ) ) ||
3+ [ 'true' , '1' ] . includes ( String ( process . env . GITHUB_ACTIONS ) . toLowerCase ( ) ) ;
4+
5+ const isCISimplified = process . env . CI || process . env . GITHUB_ACTIONS ;
6+
7+ export const testIfCI = ( name : string , fn : Mocha . Func | Mocha . AsyncFunc ) : void => {
8+ ( isCI ? test : test . skip ) ( name , fn ) ;
9+ } ;
10+
11+ export const suiteIfCI = ( name : string , fn : ( this : Mocha . Suite ) => void ) : void => {
12+ ( isCI ? suite : suite . skip ) ( name , fn ) ;
13+ } ;
14+
15+ export function testIfCIv2 ( testName : string , testFn : ( ) => void | Promise < void > ) : void {
16+ isCISimplified ? test ( testName , testFn ) : test . skip ( testName , testFn ) ;
17+ }
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import {
2525 SavedConnectionsLoadedTelemetryEvent ,
2626} from '../../../telemetry' ;
2727import type { SegmentProperties } from '../../../telemetry/telemetryService' ;
28+ import { suiteIfCI } from '../helpers' ;
2829
2930// eslint-disable-next-line @typescript-eslint/no-var-requires
3031const { version } = require ( '../../../../package.json' ) ;
@@ -35,7 +36,7 @@ chai.use(sinonChai);
3536
3637config ( { path : resolve ( __dirname , '../../../../.env' ) } ) ;
3738
38- suite ( 'Telemetry Controller Test Suite' , ( ) => {
39+ suiteIfCI ( 'Telemetry Controller Test Suite' , ( ) => {
3940 const testTelemetryService =
4041 mdbTestExtension . testExtensionController . _telemetryService ;
4142
You can’t perform that action at this time.
0 commit comments