Merge pull request #17817 from backstage/rugvip/notimeout

config-loader: avoid setTimeout in file watching tests
This commit is contained in:
Patrik Oldsberg
2023-05-16 21:34:49 +02:00
committed by GitHub
@@ -66,7 +66,7 @@ describe('FileConfigSource', () => {
setTimeout(() => {
tmp.write('a.yaml', 'a: 2');
}, 10);
}, 100);
await expect(readN(source, 2)).resolves.toEqual([
[{ data: { a: 1 }, context: 'a.yaml', path: tmp.resolve('a.yaml') }],
@@ -132,7 +132,7 @@ describe('FileConfigSource', () => {
setTimeout(() => {
tmp.write('x.yaml', '${MY_OTHER_VALUE}');
}, 10);
}, 100);
await expect(readN(source, 2)).resolves.toEqual([
[{ data: { a: '6' }, context: 'a.yaml', path: tmp.resolve('a.yaml') }],
@@ -152,7 +152,7 @@ describe('FileConfigSource', () => {
setTimeout(() => {
tmp.write('x.txt', '9');
}, 10);
}, 100);
await expect(readN(source, 2)).resolves.toEqual([
[{ data: { a: '8' }, context: 'a.yaml', path: tmp.resolve('a.yaml') }],