superdesk/superdesk-client-core

View on GitHub
scripts/tests.ts

Summary

Maintainability
A
0 mins
Test Coverage
import 'vendor';
import 'angular-mocks';
import 'core';
import 'core/tests/mocks';
import 'apps';

import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import {DEFAULT_ENGLISH_TRANSLATIONS} from 'core/utils';

window.translations = DEFAULT_ENGLISH_TRANSLATIONS;

Enzyme.configure({adapter: new Adapter()});

var testsContext = require.context('scripts', true, /.spec.(ts|tsx)$/);

testsContext.keys().filter((path) => {
    /*
        Excluding anything from extensions because:
        1. Extensions contain dependencies in node_modules directories
            which contain their own tests which we don't want to run.
        2. It's probably better if extensions run units test on their own.
    */
    return path.startsWith('./extensions/') === false;
}).forEach(testsContext);