gitlab-org--gitlab-foss/spec/frontend/test_setup.js
Winnie Hellmann f066683071
Add setTestTimeout for Jest tests
Allows contributors to set the timeout
for individual jest tests.
2019-03-08 16:21:10 +00:00

20 lines
521 B
JavaScript

import Vue from 'vue';
import Translate from '~/vue_shared/translate';
import axios from '~/lib/utils/axios_utils';
import { initializeTestTimeout } from './helpers/timeout';
initializeTestTimeout(300);
// fail tests for unmocked requests
beforeEach(done => {
axios.defaults.adapter = config => {
const error = new Error(`Unexpected unmocked request: ${JSON.stringify(config, null, 2)}`);
error.config = config;
done.fail(error);
return Promise.reject(error);
};
done();
});
Vue.use(Translate);