const { defaults } = require("jest-config");

module.exports = {
  testEnvironment: "node",
    setupFiles: [
      "<rootDir>/../apollo-server-env/dist/index.js"
    ],
    preset: "ts-jest",
    testMatch: null,
    testRegex: "/__tests__/.*\\.test\\.(js|ts)$",
    testPathIgnorePatterns: [
      "/node_modules/",
      "/dist/"
    ],
    moduleFileExtensions: [...defaults.moduleFileExtensions, "ts", "tsx"],
    moduleNameMapper: {
      '^__mocks__/(.*)$': '<rootDir>/../../__mocks__/$1',
      '^(?!apollo-server-env|apollo-engine-reporting-protobuf)(apollo-(?:server|datasource|cache-control|tracing|engine)[^/]*|graphql-extensions)(?:/dist)?((?:/.*)|$)': '<rootDir>/../../packages/$1/src$2'
    },
    clearMocks: true,
    globals: {
      "ts-jest": {
        tsConfig: "<rootDir>/src/__tests__/tsconfig.json",
        diagnostics: false
      }
    }
};

@@ -490,16 +490,396 @@
 __/$1',%0A
+      // This regex should match the packages that we want compiled from source%0A      // through %60ts-jest%60, as opposed to loaded from their output files in%0A      // %60dist%60.%0A      // We don't want to match %60apollo-server-env%60 and%0A      // %60apollo-engine-reporting-protobuf%60, because these don't depend on%0A      // compilation but need to be initialized from as parto of %60prepare%60.%0A
       '%5E

Add comments to `moduleNameMapper` option in Jest config