Fail Karma tests that take longer than a second

This commit is contained in:
Winnie Hellmann 2018-07-09 13:20:18 +02:00
parent f6d13ef53a
commit d8edaf2851
1 changed files with 13 additions and 0 deletions

View File

@ -91,6 +91,19 @@ beforeEach(() => {
Vue.http.interceptors = builtinVueHttpInterceptors.slice();
});
let longRunningTestTimeoutHandle;
beforeEach((done) => {
longRunningTestTimeoutHandle = setTimeout(() => {
done.fail('Test is running too long!');
}, 1000);
done();
});
afterEach(() => {
clearTimeout(longRunningTestTimeoutHandle);
});
const axiosDefaultAdapter = getDefaultAdapter();
// render all of our tests