2020-10-20 23:41:47 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								// We set this specifically for 2 reasons.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// 1. It makes sense for both CI tests and local tests to behave the same so issues are found earlier
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// 2. Any wrong timezone handling could be hidden if we use UTC/GMT local time (which would happen in CI).
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-17 23:19:44 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								process.env.TZ = 'Pacific/Easter'; // UTC-06:00 or UTC-05:00 depending on daylight savings
							 | 
						
					
						
							
								
									
										
										
										
											2020-09-17 14:59:20 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2023-12-20 21:14:57 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								const esModules = [
							 | 
						
					
						
							
								
									
										
										
										
											2024-01-25 18:52:49 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  '@glideapps/glide-data-grid',
							 | 
						
					
						
							
								
									
										
										
										
											2023-12-20 21:14:57 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  'ol',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  'd3',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  'd3-color',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  'd3-interpolate',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  'delaunator',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  'internmap',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  'robust-predicates',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  'leven',
							 | 
						
					
						
							
								
									
										
										
										
											2024-01-12 22:05:46 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  'nanoid',
							 | 
						
					
						
							
								
									
										
										
										
											2024-02-06 03:46:35 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  'monaco-promql',
							 | 
						
					
						
							
								
									
										
										
										
											2024-02-22 19:31:40 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  '@kusto/monaco-kusto',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  'monaco-editor',
							 | 
						
					
						
							
								
									
										
										
										
											2024-05-28 23:04:03 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  '@msagl',
							 | 
						
					
						
							
								
									
										
										
										
											2024-02-22 19:31:40 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  'lodash-es',
							 | 
						
					
						
							
								
									
										
										
										
											2024-03-27 00:10:06 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  'vscode-languageserver-types',
							 | 
						
					
						
							
								
									
										
										
										
											2024-11-05 15:34:09 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  '@bsull/augurs',
							 | 
						
					
						
							
								
									
										
										
										
											2025-05-28 21:50:15 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  'react-data-grid',
							 | 
						
					
						
							
								
									
										
										
										
											2025-06-13 23:44:02 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  '@grafana/llm',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  'pkce-challenge',
							 | 
						
					
						
							
								
									
										
										
										
											2023-12-20 21:14:57 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								].join('|');
							 | 
						
					
						
							
								
									
										
										
										
											2023-01-26 20:02:22 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-10-22 13:03:26 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								module.exports = {
							 | 
						
					
						
							
								
									
										
										
										
											2017-11-17 23:18:30 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  verbose: false,
							 | 
						
					
						
							
								
									
										
										
										
											2021-12-04 01:09:25 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  testEnvironment: 'jsdom',
							 | 
						
					
						
							
								
									
										
										
										
											2020-02-14 04:37:24 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  transform: {
							 | 
						
					
						
							
								
									
										
										
										
											2022-11-24 22:00:41 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    '^.+\\.(ts|tsx|js|jsx)$': [require.resolve('ts-jest'), { isolatedModules: true }],
							 | 
						
					
						
							
								
									
										
										
										
											2017-10-22 13:03:26 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  },
							 | 
						
					
						
							
								
									
										
										
										
											2021-07-16 03:00:19 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  transformIgnorePatterns: [
							 | 
						
					
						
							
								
									
										
										
										
											2023-01-26 20:02:22 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    `/node_modules/(?!${esModules})`, // exclude es modules to prevent TS complaining
							 | 
						
					
						
							
								
									
										
										
										
											2021-07-16 03:00:19 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  ],
							 | 
						
					
						
							
								
									
										
										
										
											2024-04-15 23:41:52 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  moduleDirectories: ['public', 'node_modules'],
							 | 
						
					
						
							
								
									
										
										
										
											2024-03-21 18:36:37 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  roots: ['<rootDir>/public/app', '<rootDir>/public/test', '<rootDir>/packages', '<rootDir>/scripts/tests'],
							 | 
						
					
						
							
								
									
										
										
										
											2020-02-14 04:37:24 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  testRegex: '(\\.|/)(test)\\.(jsx?|tsx?)$',
							 | 
						
					
						
							
								
									
										
										
										
											2025-05-29 04:14:43 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'cjs'],
							 | 
						
					
						
							
								
									
										
										
										
											2023-05-15 16:15:26 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  setupFiles: ['jest-canvas-mock', './public/test/jest-setup.ts'],
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-19 18:40:10 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  testTimeout: 30000,
							 | 
						
					
						
							
								
									
										
										
										
											2022-05-30 21:14:34 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  resolver: `<rootDir>/public/test/jest-resolver.js`,
							 | 
						
					
						
							
								
									
										
										
										
											2020-08-20 21:21:42 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  setupFilesAfterEnv: ['./public/test/setupTests.ts'],
							 | 
						
					
						
							
								
									
										
										
										
											2021-04-23 15:06:19 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  globals: {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    __webpack_public_path__: '', // empty string
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  },
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-04 21:05:31 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  moduleNameMapper: {
							 | 
						
					
						
							
								
									
										
										
										
											2025-05-12 17:34:17 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    '\\.(svg|png|jpg)': '<rootDir>/public/test/mocks/images.ts',
							 | 
						
					
						
							
								
									
										
										
										
											2020-06-30 01:58:47 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    '\\.css': '<rootDir>/public/test/mocks/style.ts',
							 | 
						
					
						
							
								
									
										
										
										
											2023-10-24 19:16:32 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    'react-inlinesvg': '<rootDir>/public/test/mocks/react-inlinesvg.tsx',
							 | 
						
					
						
							
								
									
										
										
										
											2024-02-22 19:31:40 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    // resolve directly as monaco and kusto don't have main property in package.json which jest needs
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    '^monaco-editor$': 'monaco-editor/esm/vs/editor/editor.api.js',
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    '@kusto/monaco-kusto': '@kusto/monaco-kusto/release/esm/monaco.contribution.js',
							 | 
						
					
						
							
								
									
										
										
										
											2023-06-05 16:51:36 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    // near-membrane-dom won't work in a nodejs environment.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    '@locker/near-membrane-dom': '<rootDir>/public/test/mocks/nearMembraneDom.ts',
							 | 
						
					
						
							
								
									
										
										
										
											2023-07-05 22:24:48 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    '^@grafana/schema/dist/esm/(.*)$': '<rootDir>/packages/grafana-schema/src/$1',
							 | 
						
					
						
							
								
									
										
										
										
											2023-08-31 21:45:44 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    // prevent systemjs amd extra from breaking tests.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    'systemjs/dist/extras/amd': '<rootDir>/public/test/mocks/systemjsAMDExtra.ts',
							 | 
						
					
						
							
								
									
										
										
										
											2024-11-05 15:34:09 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    '@bsull/augurs': '<rootDir>/public/test/mocks/augurs.ts',
							 | 
						
					
						
							
								
									
										
										
										
											2020-05-04 21:05:31 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  },
							 | 
						
					
						
							
								
									
										
										
										
											2022-12-27 19:06:06 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  // Log the test results with dynamic Loki tags. Drone CI only
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  reporters: ['default', ['<rootDir>/public/test/log-reporter.js', { enable: process.env.DRONE === 'true' }]],
							 | 
						
					
						
							
								
									
										
										
										
											2024-03-21 19:54:19 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
							 | 
						
					
						
							
								
									
										
										
										
											2017-10-22 13:03:26 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								};
							 |