File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
packages/instrumentation-pg/test Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -937,6 +937,22 @@ describe('pg-pool', () => {
937937} ) ;
938938
939939describe ( 'pg-pool (ESM)' , ( ) => {
940+ const testPostgres = process . env . RUN_POSTGRES_TESTS ;
941+ const shouldTest = testPostgres ; // Skips these tests if false (default)
942+
943+ before ( function ( ) {
944+ const skip = ( ) => {
945+ // this.skip() workaround
946+ // https://github.com/mochajs/mocha/issues/2683#issuecomment-375629901
947+ this . test ! . parent ! . pending = true ;
948+ this . skip ( ) ;
949+ } ;
950+
951+ if ( ! shouldTest ) {
952+ skip ( ) ;
953+ }
954+ } ) ;
955+
940956 it ( 'should work with ESM usage' , async ( ) => {
941957 await testUtils . runTestFixture ( {
942958 cwd : __dirname ,
Original file line number Diff line number Diff line change @@ -1087,6 +1087,22 @@ describe('pg', () => {
10871087} ) ;
10881088
10891089describe ( 'pg (ESM)' , ( ) => {
1090+ const testPostgres = process . env . RUN_POSTGRES_TESTS ;
1091+ const shouldTest = testPostgres ; // Skips these tests if false (default)
1092+
1093+ before ( function ( ) {
1094+ const skip = ( ) => {
1095+ // this.skip() workaround
1096+ // https://github.com/mochajs/mocha/issues/2683#issuecomment-375629901
1097+ this . test ! . parent ! . pending = true ;
1098+ this . skip ( ) ;
1099+ } ;
1100+
1101+ if ( ! shouldTest ) {
1102+ skip ( ) ;
1103+ }
1104+ } ) ;
1105+
10901106 it ( 'should work with ESM usage' , async ( ) => {
10911107 await testUtils . runTestFixture ( {
10921108 cwd : __dirname ,
You can’t perform that action at this time.
0 commit comments