-
Notifications
You must be signed in to change notification settings - Fork 7
/
jest.setup.js
25 lines (22 loc) · 893 Bytes
/
jest.setup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import 'angular';
// Do not update Jest to its v27 or greater because it conflicts with angular.mocks
// angular.mock.module function vanishes from the API and all tests break.
import 'angular-mocks';
import path from 'path';
import * as Babel from '@babel/standalone/babel.min'
import Staly from '@compilorama/staly';
import React from 'react';
import ReactDOM from 'react-dom';
import Vue from 'vue/dist/vue.min';
import project from './project.json';
// Needs to be mocked before importing index template, otherwise
// Analytics Service will be imported, cached and it won't be
// "mockable" anymore.
jest.mock('@compilorama/staly');
// Import index template to register pitsby-app angular module
// and its dependencies
require(path.join(__dirname, project.scripts.webapp.source.indexTemplate));
global.Babel = Babel;
global.Vue = Vue;
global.React = React;
global.ReactDOM = ReactDOM;