@@ -5,7 +5,8 @@ import * as fs from 'fs';
5
5
import rimraf from 'rimraf' ;
6
6
import {
7
7
copyFileToTempDir ,
8
- openAndSetProjectDir
8
+ openAndSetProjectDir ,
9
+ wait
9
10
} from './helpers' ;
10
11
11
12
import Config from '../lib/config' ;
@@ -20,7 +21,7 @@ const paths = {
20
21
21
22
22
23
// Skipping until we can sort out why these are so flaky in CI.
23
- xdescribe ( 'Config module' , ( ) => {
24
+ describe ( 'Config module' , ( ) => {
24
25
25
26
beforeEach ( async ( ) => {
26
27
atom . config . set ( 'linter-eslint-node.foo' , '' ) ;
@@ -118,7 +119,8 @@ xdescribe('Config module', () => {
118
119
it ( 'reacts to changes made to .linter-eslint' , async ( ) => {
119
120
editor . setText ( JSON . stringify ( { foo : 'zort' } ) ) ;
120
121
await editor . save ( ) ;
121
- Config . update ( ) ;
122
+ await wait ( 1000 ) ;
123
+
122
124
expect ( Config . get ( 'foo' ) ) . toBe ( 'zort' ) ;
123
125
} ) ;
124
126
@@ -127,20 +129,20 @@ xdescribe('Config module', () => {
127
129
let disposable = Config . onConfigDidChange ( handler . call ) ;
128
130
editor . setText ( JSON . stringify ( { foo : 'wat' } ) ) ;
129
131
await editor . save ( ) ;
132
+ await wait ( 1000 ) ;
133
+
130
134
expect ( handler . called ( ) ) . toBe ( true ) ;
131
- let [ config , prevConfig ] = handler . calledWith [ 0 ] ;
135
+ let [ config , prevConfig ] = handler . calledWith [ 0 ] || [ ] ;
132
136
expect ( config . foo ) . toBe ( 'wat' ) ;
133
137
expect ( prevConfig . foo ) . toBe ( 'thud' ) ;
134
138
disposable . dispose ( ) ;
135
139
} ) ;
136
140
137
- // Skipping test because it relies too much on precise timing of moving
138
- // parts; passes locally but tends to fail on CI.
139
- // TODO: See about rewriting this.
140
- xit ( 'stops treating .linter-eslint as an overrides file if we rename it' , async ( ) => {
141
+ it ( 'stops treating .linter-eslint as an overrides file if we rename it' , async ( ) => {
141
142
expect ( Config . get ( 'foo' ) ) . toBe ( 'thud' ) ;
142
143
fs . renameSync ( tempPath , `${ tempDir } ${ path . sep } _linter-eslint` ) ;
143
- Config . rescan ( ) ;
144
+ await wait ( 1000 ) ;
145
+
144
146
expect ( Config . get ( 'foo' ) ) . toBe ( '' ) ;
145
147
} ) ;
146
148
0 commit comments