@@ -5,8 +5,7 @@ import * as fs from 'fs';
5
5
import rimraf from 'rimraf' ;
6
6
import {
7
7
copyFileToTempDir ,
8
- openAndSetProjectDir ,
9
- setTimeout
8
+ openAndSetProjectDir
10
9
} from './helpers' ;
11
10
12
11
import Config from '../lib/config' ;
@@ -20,16 +19,16 @@ const paths = {
20
19
} ;
21
20
22
21
// Returns a Promise that resolves the next time the config changes.
23
- function untilConfigChanges ( ) {
24
- return new Promise ( ( resolve , reject ) => {
25
- let timeout = setTimeout ( reject , 5000 ) ;
26
- let disposable = Config . onConfigDidChange ( ( config , prevConfig ) => {
27
- clearTimeout ( timeout ) ;
28
- disposable . dispose ( ) ;
29
- resolve ( config , prevConfig ) ;
30
- } ) ;
31
- } ) ;
32
- }
22
+ // function untilConfigChanges () {
23
+ // return new Promise((resolve, reject) => {
24
+ // let timeout = setTimeout(reject, 5000);
25
+ // let disposable = Config.onConfigDidChange((config, prevConfig) => {
26
+ // clearTimeout(timeout);
27
+ // disposable.dispose();
28
+ // resolve(config, prevConfig);
29
+ // });
30
+ // });
31
+ // }
33
32
34
33
describe ( 'Config module' , ( ) => {
35
34
@@ -146,11 +145,8 @@ describe('Config module', () => {
146
145
147
146
it ( 'stops treating .linter-eslint as an overrides file if we rename it' , async ( ) => {
148
147
expect ( Config . get ( 'foo' ) ) . toBe ( 'thud' ) ;
149
-
150
- let promise = untilConfigChanges ( ) ;
151
148
fs . renameSync ( tempPath , `${ tempDir } ${ path . sep } _linter-eslint` ) ;
152
- await promise ;
153
-
149
+ Config . rescan ( ) ;
154
150
expect ( Config . get ( 'foo' ) ) . toBe ( '' ) ;
155
151
} ) ;
156
152
0 commit comments