2021-04-02 09:47:16 +00:00
|
|
|
|
function parseConfig() {
|
|
|
|
|
|
return "";
|
|
|
|
|
|
}
|
|
|
|
|
|
const LOG_LEVELS = ["debug", "error"];
|
|
|
|
|
|
const CONFIG_LOG_LEVEL_INDEX = 1;
|
|
|
|
|
|
|
2020-04-23 14:57:37 +00:00
|
|
|
|
module.exports = {
|
2021-04-02 09:47:16 +00:00
|
|
|
|
setupFiles: ["jest-canvas-mock"],
|
2020-04-23 14:57:37 +00:00
|
|
|
|
roots: ["<rootDir>/src"],
|
|
|
|
|
|
transform: {
|
2020-10-06 06:36:57 +00:00
|
|
|
|
"^.+\\.(png|js|ts|tsx)$": "ts-jest",
|
2020-04-23 14:57:37 +00:00
|
|
|
|
},
|
2022-05-30 12:22:54 +00:00
|
|
|
|
testEnvironment: "jsdom",
|
|
|
|
|
|
testTimeout: 9000,
|
2021-04-02 09:47:16 +00:00
|
|
|
|
setupFilesAfterEnv: ["<rootDir>/test/setup.ts"],
|
2021-03-24 19:25:38 +00:00
|
|
|
|
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(tsx|ts|js)?$",
|
2020-04-23 14:57:37 +00:00
|
|
|
|
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node", "css"],
|
2021-04-02 09:47:16 +00:00
|
|
|
|
moduleDirectories: ["node_modules", "src", "test"],
|
2021-02-16 10:29:08 +00:00
|
|
|
|
transformIgnorePatterns: [
|
2023-05-11 05:26:03 +00:00
|
|
|
|
"<rootDir>/node_modules/(?!codemirror|design-system-old|react-dnd|dnd-core|@babel|(@blueprintjs/core)|@github|lodash-es|@draft-js-plugins|react-documents|linkedom)",
|
2021-02-16 10:29:08 +00:00
|
|
|
|
],
|
2020-07-01 10:01:07 +00:00
|
|
|
|
moduleNameMapper: {
|
|
|
|
|
|
"\\.(css|less)$": "<rootDir>/test/__mocks__/styleMock.js",
|
|
|
|
|
|
"\\.svg$": "<rootDir>/test/__mocks__/svgMock.js",
|
2023-05-11 05:26:03 +00:00
|
|
|
|
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|txt)$":
|
2021-02-16 10:29:08 +00:00
|
|
|
|
"<rootDir>/test/__mocks__/fileMock.js",
|
2021-04-02 09:47:16 +00:00
|
|
|
|
"^worker-loader!": "<rootDir>/test/__mocks__/workerMock.js",
|
2021-04-27 07:16:54 +00:00
|
|
|
|
"^!!raw-loader!": "<rootDir>/test/__mocks__/derivedMock.js",
|
2021-04-02 09:47:16 +00:00
|
|
|
|
"test/(.*)": "<rootDir>/test/$1",
|
2022-01-07 06:08:17 +00:00
|
|
|
|
"@appsmith/(.*)": "<rootDir>/src/ee/$1",
|
2023-05-11 05:26:03 +00:00
|
|
|
|
"design-system-old": "<rootDir>/../node_modules/design-system-old/build",
|
|
|
|
|
|
"^proxy-memoize$":
|
|
|
|
|
|
"<rootDir>/../node_modules/proxy-memoize/dist/wrapper.cjs",
|
|
|
|
|
|
// @blueprintjs packages need to be resolved to the `esnext` directory. The default `esm` directory
|
|
|
|
|
|
// contains sources that are transpiled to ES5. As Jest does not transpile our sources to ES5,
|
|
|
|
|
|
// this results in mixing ES6 and ES5 code and causes errors like:
|
|
|
|
|
|
// Class constructor GlobalHotKeys cannot be invoked without 'new'
|
|
|
|
|
|
// Note: this isn’t issue in the live app because we transpile *everything* down to ES5 there.
|
|
|
|
|
|
"^@blueprintjs/core$":
|
|
|
|
|
|
"<rootDir>/../node_modules/@blueprintjs/core/lib/esnext",
|
|
|
|
|
|
"^@blueprintjs/datetime$":
|
|
|
|
|
|
"<rootDir>/../node_modules/@blueprintjs/datetime/lib/esnext",
|
|
|
|
|
|
"^@blueprintjs/icons$":
|
|
|
|
|
|
"<rootDir>/../node_modules/@blueprintjs/icons/lib/esnext",
|
|
|
|
|
|
"^@blueprintjs/popover2$":
|
|
|
|
|
|
"<rootDir>/../node_modules/@blueprintjs/popover2/lib/esnext",
|
|
|
|
|
|
"^@blueprintjs/select$":
|
|
|
|
|
|
"<rootDir>/../node_modules/@blueprintjs/select/lib/esnext",
|
2021-04-02 09:47:16 +00:00
|
|
|
|
},
|
|
|
|
|
|
globals: {
|
2021-05-18 18:29:39 +00:00
|
|
|
|
"ts-jest": {
|
|
|
|
|
|
isolatedModules: true,
|
2022-11-03 09:23:15 +00:00
|
|
|
|
diagnostics: {
|
|
|
|
|
|
ignoreCodes: [1343],
|
|
|
|
|
|
},
|
|
|
|
|
|
astTransformers: {
|
|
|
|
|
|
before: [
|
|
|
|
|
|
{
|
|
|
|
|
|
path: "node_modules/ts-jest-mock-import-meta",
|
|
|
|
|
|
options: { metaObjectReplacement: { url: "https://www.url.com" } },
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
},
|
2021-05-18 18:29:39 +00:00
|
|
|
|
},
|
2021-04-02 09:47:16 +00:00
|
|
|
|
APPSMITH_FEATURE_CONFIGS: {
|
|
|
|
|
|
sentry: {
|
|
|
|
|
|
dsn: parseConfig("__APPSMITH_SENTRY_DSN__"),
|
|
|
|
|
|
release: parseConfig("__APPSMITH_SENTRY_RELEASE__"),
|
|
|
|
|
|
environment: parseConfig("__APPSMITH_SENTRY_ENVIRONMENT__"),
|
|
|
|
|
|
},
|
|
|
|
|
|
smartLook: {
|
|
|
|
|
|
id: parseConfig("__APPSMITH_SMART_LOOK_ID__"),
|
|
|
|
|
|
},
|
|
|
|
|
|
enableRapidAPI: parseConfig("__APPSMITH_MARKETPLACE_ENABLED__"),
|
|
|
|
|
|
segment: {
|
|
|
|
|
|
apiKey: parseConfig("__APPSMITH_SEGMENT_KEY__"),
|
|
|
|
|
|
ceKey: parseConfig("__APPSMITH_SEGMENT_CE_KEY__"),
|
|
|
|
|
|
},
|
|
|
|
|
|
fusioncharts: {
|
|
|
|
|
|
licenseKey: parseConfig("__APPSMITH_FUSIONCHARTS_LICENSE_KEY__"),
|
|
|
|
|
|
},
|
|
|
|
|
|
enableMixpanel: parseConfig("__APPSMITH_SEGMENT_KEY__"),
|
|
|
|
|
|
algolia: {
|
|
|
|
|
|
apiId: parseConfig("__APPSMITH_ALGOLIA_API_ID__"),
|
|
|
|
|
|
apiKey: parseConfig("__APPSMITH_ALGOLIA_API_KEY__"),
|
|
|
|
|
|
indexName: parseConfig("__APPSMITH_ALGOLIA_SEARCH_INDEX_NAME__"),
|
|
|
|
|
|
},
|
|
|
|
|
|
logLevel:
|
|
|
|
|
|
CONFIG_LOG_LEVEL_INDEX > -1
|
|
|
|
|
|
? LOG_LEVELS[CONFIG_LOG_LEVEL_INDEX]
|
|
|
|
|
|
: LOG_LEVELS[1],
|
|
|
|
|
|
cloudHosting: "CLOUD_HOSTING",
|
|
|
|
|
|
enableTNCPP: parseConfig("__APPSMITH_TNC_PP__"),
|
|
|
|
|
|
appVersion: {
|
|
|
|
|
|
id: parseConfig("__APPSMITH_VERSION_ID__"),
|
|
|
|
|
|
releaseDate: parseConfig("__APPSMITH_VERSION_RELEASE_DATE__"),
|
|
|
|
|
|
},
|
|
|
|
|
|
intercomAppID: "APP_ID",
|
|
|
|
|
|
mailEnabled: parseConfig("__APPSMITH_MAIL_ENABLED__"),
|
|
|
|
|
|
|
2022-07-28 08:38:37 +00:00
|
|
|
|
hideWatermark: parseConfig("__APPSMITH_HIDE_WATERMARK__"),
|
2022-11-03 09:23:15 +00:00
|
|
|
|
disableIframeWidgetSandbox: parseConfig(
|
|
|
|
|
|
"__APPSMITH_DISABLE_IFRAME_WIDGET_SANDBOX__",
|
|
|
|
|
|
),
|
2021-04-02 09:47:16 +00:00
|
|
|
|
},
|
2020-07-01 10:01:07 +00:00
|
|
|
|
},
|
2020-04-23 14:57:37 +00:00
|
|
|
|
};
|