// test dependencies that require transformation
const pluginsToTransform = [
  'phovea_clue',
  'phovea_vis'
].join('|');

/**
 * TODO check if we can process inline webpack loaders (e.g. as found in https://github.com/phovea/phovea_ui/blob/master/src/_bootstrap.ts)
 * see also https://jestjs.io/docs/en/webpack#mocking-css-modules
 */
module.exports = {
  transform: {
    "^.+\\.tsx?$": "ts-jest",
    "\\.xml$": "jest-raw-loader"
  },
  testRegex: "(.*(test|spec))\\.(tsx?)$",
  testURL: "http://localhost/",
  moduleFileExtensions: [
    "ts",
    "tsx",
    "js",
    "jsx",
    "json",
    "node"
  ],
  modulePaths: [
    "src",
    "../"
  ],
  transformIgnorePatterns: [`../node_modules/(?!${pluginsToTransform})`],
  globals: {
    "__VERSION__": "TEST_VERSION",
    "__APP_CONTEXT__": "TEST_CONTEXT"
  },
  moduleNameMapper: {
    "^.+\\.(css|less|scss|sass)$": "identity-obj-proxy",
    "imports-loader?.*": "imports-loader",
    "raw-loader?.*": "raw-loader",
    "file-loader?.*": "file-loader",
    "script-loader?.*": "script-loader"
  }
}

@@ -46,12 +46,10 @@
 ion%0A
-cons
+le
 t pl
@@ -76,19 +76,13 @@
 %0A  '
-phovea_clue
+tdp_*
 ',%0A 
@@ -94,10 +94,22 @@
 vea_
-vi
+*',%0A  'lineupj
 s'%0A%5D
@@ -121,16 +121,405 @@
 ('%7C');%0A%0A
+if(pluginsToTransform.length %3E 0) %7B%0A /**  Attention: Negative Lookahead! This regex adds the specified repos to a whitelist that holds plugins that are excluded from the transformIgnorePatterns.%0A  * This means that pluginsToTransform should contain all repos that export ts files. They can only be handled by the transformation. */%0A    pluginsToTransform = %60(?!$%7BpluginsToTransform%7D)%60;%0A%7D%0A%0A
 /**%0A * T
@@ -872,40 +872,8 @@
 $%22,%0A
-  testURL: %22http://localhost/%22,%0A
   mo
@@ -992,16 +992,39 @@
  %22src%22,%0A
+    %22../node_modules%22,%0A
     %22../
@@ -1075,19 +1075,54 @@
 modules/
-(?!
+$%7BpluginsToTransform%7D%60, %60node_modules/
 $%7Bplugin
@@ -1134,17 +1134,16 @@
 ansform%7D
-)
 %60%5D,%0A  gl
@@ -1223,16 +1223,161 @@
 CONTEXT%22
+,%0A    'ts-jest': %7B%0A      // has to be set to true, otherwise i18n import fails%0A      %22tsConfig%22: %7B%0A        %22esModuleInterop%22: true,%0A      %7D%0A    %7D
 %0A  %7D,%0A  

unify jest config