Skip to content

Commit 8d978a0

Browse files
committed
test: set SAVE_TIMEOUT
1 parent dd924fb commit 8d978a0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

spec/CodeFormatManager-spec.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import waitsFor from '@artemv/wait-until-promise';
1010

1111
const sleep = n => new Promise(r => setTimeout(r, n));
1212

13+
jasmine.DEFAULT_TIMEOUT_INTERVAL = SAVE_TIMEOUT + 100
14+
1315
describe('CodeFormatManager', () => {
1416
let textEditor;
1517
let manager;
@@ -46,7 +48,7 @@ describe('CodeFormatManager', () => {
4648
atom.views.getView(textEditor),
4749
'code-format:format-code',
4850
);
49-
await waitsFor(() => textEditor.getText() === 'def');
51+
await waitsFor(() => textEditor.getText() === 'def', SAVE_TIMEOUT);
5052
});
5153

5254
it('format an editor using formatEntireFile', async () => {
@@ -61,7 +63,7 @@ describe('CodeFormatManager', () => {
6163
atom.views.getView(textEditor),
6264
'code-format:format-code',
6365
);
64-
await waitsFor(() => textEditor.getText() === 'ghi');
66+
await waitsFor(() => textEditor.getText() === 'ghi', SAVE_TIMEOUT);
6567
});
6668

6769
it('formats an editor on type', async () => {
@@ -87,7 +89,7 @@ describe('CodeFormatManager', () => {
8789
textEditor.insertText('b');
8890
textEditor.insertText('c');
8991

90-
await waitsFor(() => textEditor.getText() === 'def');
92+
await waitsFor(() => textEditor.getText() === 'def', SAVE_TIMEOUT);
9193
// Debouncing should ensure only one format call.
9294
expect(spy.mock.calls.length).toBe(1);
9395
});
@@ -128,7 +130,7 @@ describe('CodeFormatManager', () => {
128130

129131
// Wait until the buffer has been saved and verify it has been saved exactly
130132
// once.
131-
await waitsFor(() => spy.mock.calls.length > 0);
133+
await waitsFor(() => spy.mock.calls.length > 0, SAVE_TIMEOUT);
132134
expect(spy.mock.calls.length).toBe(1);
133135
});
134136
});

0 commit comments

Comments
 (0)