index.js 980 B

12345678910111213141516171819202122232425262728293031
  1. require('@babel/polyfill/lib/noConflict');
  2. require('jasmine-co').install();
  3. let testPathRegExp = null;
  4. if (typeof __ENV_ARGS__ === 'object' && __ENV_ARGS__.testPathPattern) {
  5. // Remove string between % signs. On Windows' machines an empty env variable was visible as '%{variable_name}%' so it must be stripped.
  6. // See https://github.com/handsontable/handsontable/issues/4378).
  7. const pattern = __ENV_ARGS__.testPathPattern.replace(/^%(.*)%$/, '');
  8. if (pattern) {
  9. testPathRegExp = new RegExp(pattern, 'i');
  10. }
  11. }
  12. const ignoredE2ETestsPath = './mobile';
  13. [
  14. require.context('.', true, /\.spec\.js$/),
  15. require.context('./../../src/plugins', true, /\.e2e\.js$/),
  16. ].forEach((req) => {
  17. req.keys().forEach((filePath) => {
  18. if (filePath.includes(ignoredE2ETestsPath) === false) {
  19. if (testPathRegExp === null || (testPathRegExp instanceof RegExp && testPathRegExp.test(filePath))) {
  20. req(filePath);
  21. }
  22. }
  23. });
  24. });
  25. require('./MemoryLeakTest');