enable jasmine/no-promise-without-done-fail

This commit is contained in:
Johann Hubert Sonntagbauer 2018-10-09 19:17:36 +02:00
parent 1dfecf3e17
commit 0fd203ba24
7 changed files with 17 additions and 19 deletions

View file

@ -37,5 +37,4 @@ rules:
- 'fixtures/blob'
# Temporarily disabled to facilitate an upgrade to eslint-plugin-jasmine
jasmine/new-line-before-expect: off
jasmine/no-promise-without-done-fail: off
jasmine/prefer-toHaveBeenCalledWith: off

View file

@ -112,6 +112,6 @@ describe('Board component', () => {
).toBe(true);
done();
});
}).catch(done.fail);
});
});

View file

@ -1,4 +1,3 @@
/* eslint-disable promise/catch-or-return */
import axios from '~/lib/utils/axios_utils';
import * as commonUtils from '~/lib/utils/common_utils';
import MockAdapter from 'axios-mock-adapter';
@ -360,10 +359,10 @@ describe('common_utils', () => {
}).then((resp) => {
stop(resp);
})
)).then((respBackoff) => {
).catch(done.fail)).then((respBackoff) => {
expect(respBackoff).toBe(expectedResponseValue);
done();
});
}).catch(done.fail);
});
it('catches the rejected promise from the callback ', (done) => {
@ -394,12 +393,12 @@ describe('common_utils', () => {
stop(resp);
}
})
)).then((respBackoff) => {
).catch(done.fail)).then((respBackoff) => {
const timeouts = window.setTimeout.calls.allArgs().map(([, timeout]) => timeout);
expect(timeouts).toEqual([2000, 4000]);
expect(respBackoff).toBe(expectedResponseValue);
done();
});
}).catch(done.fail);
});
it('rejects the backOff promise after timing out', (done) => {
@ -460,7 +459,7 @@ describe('common_utils', () => {
commonUtils.createOverlayIcon(faviconDataUrl, overlayDataUrl).then((url) => {
expect(url).toEqual(faviconWithOverlayDataUrl);
done();
});
}).catch(done.fail);
});
});
@ -480,7 +479,7 @@ describe('common_utils', () => {
commonUtils.setFaviconOverlay(overlayDataUrl).then(() => {
expect(document.getElementById('favicon').getAttribute('href')).toEqual(faviconWithOverlayDataUrl);
done();
});
}).catch(done.fail);
});
});

View file

@ -719,7 +719,7 @@ describe('Pipelines', () => {
expect(vm.poll.restart).toHaveBeenCalled();
done();
}, 0);
});
}).catch(done.fail);
}, 0);
});
});

View file

@ -96,8 +96,8 @@ describe('GkeMachineTypeDropdown', () => {
return vm.$nextTick().then(() => {
expect(vm.$el.querySelector('input').value).toBe(selectedMachineTypeMock);
done();
});
});
}).catch(done.fail);
}).catch(done.fail);
});
});
});

View file

@ -57,13 +57,13 @@ describe('GkeProjectIdDropdown', () => {
expect(vm.toggleText).toBe(LABELS.DEFAULT);
done();
}));
}).catch(done.fail));
it('returns project name if project selected', done =>
vm.$nextTick().then(() => {
expect(vm.toggleText).toBe(selectedProjectMock.name);
done();
}));
}).catch(done.fail));
it('returns empty toggle text', done =>
vm.$nextTick().then(() => {
@ -72,7 +72,7 @@ describe('GkeProjectIdDropdown', () => {
expect(vm.toggleText).toBe(LABELS.EMPTY);
done();
}));
}).catch(done.fail));
});
describe('selectItem', () => {
@ -85,8 +85,8 @@ describe('GkeProjectIdDropdown', () => {
return vm.$nextTick().then(() => {
expect(vm.$el.querySelector('input').value).toBe(selectedProjectMock.projectId);
done();
});
});
}).catch(done.fail);
}).catch(done.fail);
});
});
});

View file

@ -81,8 +81,8 @@ describe('GkeZoneDropdown', () => {
return vm.$nextTick().then(() => {
expect(vm.$el.querySelector('input').value).toBe(selectedZoneMock);
done();
});
});
}).catch(done.fail);
}).catch(done.fail);
});
});
});