24
24
25
25
*/
26
26
27
+ import * as process from 'node:process' ;
27
28
import { before , beforeEach , after , afterEach , describe , it } from 'node:test' ;
28
29
import { createWritableStream , LookerNodeSDK , readIniConfig } from '../src' ;
29
30
import { expect } from 'expect' ;
@@ -57,10 +58,6 @@ import { TestConfig } from '@looker/sdk-codegen-utils';
57
58
import { specToModel } from '@looker/sdk-codegen' ;
58
59
import fs from 'fs' ;
59
60
60
- // TODO Temporary equivalents to ease porting
61
- const beforeAll = before ;
62
- const afterAll = after ;
63
-
64
61
/** Note, these tests are for the Node test runner because jest has trouble with
65
62
* real calls to node's native fetch functionality
66
63
*/
@@ -423,11 +420,11 @@ describe('LookerNodeSDK integration tests', () => {
423
420
} ) ;
424
421
425
422
describe ( 'User CRUD-it checks' , ( ) => {
426
- beforeAll ( async ( ) => {
423
+ before ( async ( ) => {
427
424
await removeTestUsers ( ) ;
428
425
} ) ;
429
426
430
- afterAll ( async ( ) => {
427
+ after ( async ( ) => {
431
428
await removeTestUsers ( ) ;
432
429
} ) ;
433
430
@@ -477,7 +474,7 @@ describe('LookerNodeSDK integration tests', () => {
477
474
} ) ;
478
475
479
476
describe ( 'User searches' , ( ) => {
480
- beforeAll ( async ( ) => {
477
+ before ( async ( ) => {
481
478
await removeTestUsers ( ) ;
482
479
await createTestUsers ( ) ;
483
480
} ) ;
@@ -608,7 +605,8 @@ describe('LookerNodeSDK integration tests', () => {
608
605
let count = 0 ;
609
606
let actual : IDashboard [ ] = [ ] ;
610
607
const aggregate = ( page : IDashboard [ ] ) => {
611
- console . log ( `Page ${ ++ count } has ${ page . length } items` ) ;
608
+ count ++ ;
609
+ // console.log(`Page ${count} has ${page.length} items`);
612
610
actual = actual . concat ( page ) ;
613
611
return page ;
614
612
} ;
@@ -631,7 +629,8 @@ describe('LookerNodeSDK integration tests', () => {
631
629
let count = 0 ;
632
630
let actual : IDashboard [ ] = [ ] ;
633
631
const aggregate = ( page : IDashboard [ ] ) => {
634
- console . log ( `Page ${ ++ count } has ${ page . length } items` ) ;
632
+ count ++ ;
633
+ // console.log(`Page ${count} has ${page.length} items`);
635
634
actual = actual . concat ( page ) ;
636
635
return page ;
637
636
} ;
@@ -762,7 +761,7 @@ describe('LookerNodeSDK integration tests', () => {
762
761
763
762
describe ( 'parses a query with no results' , ( ) => {
764
763
let query ;
765
- beforeAll ( async ( ) => {
764
+ before ( async ( ) => {
766
765
query = await sdk . ok (
767
766
sdk . create_query ( {
768
767
model : 'system__activity' ,
@@ -813,7 +812,7 @@ describe('LookerNodeSDK integration tests', () => {
813
812
return qhash [ Object . keys ( qhash ) [ 0 ] ] . id ;
814
813
} ;
815
814
816
- beforeAll ( async ( ) => {
815
+ before ( async ( ) => {
817
816
// test dashboards are removed here, but not in top-level tear-down because
818
817
// we may want to view them after the test
819
818
await removeTestDashboards ( ) ;
@@ -1013,7 +1012,7 @@ describe('LookerNodeSDK integration tests', () => {
1013
1012
} ) ;
1014
1013
1015
1014
describe ( 'Node environment' , ( ) => {
1016
- beforeAll ( ( ) => {
1015
+ before ( ( ) => {
1017
1016
const section = readIniConfig (
1018
1017
config . localIni ,
1019
1018
environmentPrefix ,
@@ -1029,7 +1028,7 @@ describe('LookerNodeSDK integration tests', () => {
1029
1028
process . env [ strLookerVerifySsl ] = verify_ssl . toString ( ) ;
1030
1029
} ) ;
1031
1030
1032
- afterAll ( ( ) => {
1031
+ after ( ( ) => {
1033
1032
// reset environment variables
1034
1033
delete process . env [ strLookerTimeout ] ;
1035
1034
delete process . env [ strLookerClientId ] ;
0 commit comments