File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-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 = (
8+ name : string ,
9+ fn : Mocha . Func | Mocha . AsyncFunc ,
10+ ) : void => {
11+ ( isCI ? test : test . skip ) ( name , fn ) ;
12+ } ;
13+
14+ export const suiteIfCI = (
15+ name : string ,
16+ fn : ( this : Mocha . Suite ) => void ,
17+ ) : void => {
18+ ( isCI ? suite : suite . skip ) ( name , fn ) ;
19+ } ;
20+
21+ export function testIfCIv2 (
22+ testName : string ,
23+ testFn : ( ) => void | Promise < void > ,
24+ ) : void {
25+ isCISimplified ? test ( testName , testFn ) : test . skip ( testName , testFn ) ;
26+ }
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