index.js 790 B

1234567891011121314151617181920212223242526
  1. require('@babel/polyfill');
  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. [
  13. require.context('.', true, /\.spec\.js$/)
  14. ].forEach((req) => {
  15. req.keys().forEach((filePath) => {
  16. if (testPathRegExp === null || (testPathRegExp instanceof RegExp && testPathRegExp.test(filePath))) {
  17. req(filePath);
  18. }
  19. });
  20. });
  21. require('../MemoryLeakTest');