Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2139,7 +2139,7 @@
"mochawesome-merge": "5.1.1",
"mock-fs": "5.5.0",
"ms-chromium-edge-driver": "0.5.1",
"msw": "2.12.14",
"msw": "2.13.4",
"mutation-observer": "1.0.3",
"nock": "12.0.3",
"node-stdlib-browser": "1.3.1",
Expand Down
4 changes: 2 additions & 2 deletions src/platform/packages/shared/kbn-test/jest-preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ module.exports = {

// A map from regular expressions to paths to transformers
transform: {
'^.+\\.(js|tsx?)$':
'^.+\\.(js|mjs|tsx?)$':
'<rootDir>/src/platform/packages/shared/kbn-test/src/jest/transforms/babel/index.js',
'^.+\\.(txt|html|yaml|yml)?$':
'<rootDir>/src/platform/packages/shared/kbn-test/src/jest/transforms/raw.js',
Expand All @@ -128,7 +128,7 @@ module.exports = {
transformIgnorePatterns: [
// ignore all node_modules except monaco-editor, monaco-yaml, monaco-promql which requires babel transforms to handle dynamic import()
// since ESM modules are not natively supported in Jest yet (https://github.com/facebook/jest/issues/4842)
'[/\\\\]node_modules(?![\\/\\\\](byte-size|monaco-editor|monaco-yaml|monaco-promql|monaco-languageserver-types|monaco-marker-data-provider|monaco-worker-manager|vscode-languageserver-types|d3-interpolate|d3-color|date-fns|react-day-picker|langchain|langsmith|@cfworker|gpt-tokenizer|flat|@langchain|eventsource-parser|fast-check|@fast-check/jest|@assemblyscript|quickselect|rbush|zod/v4|vega-interpreter|vega-util|vega-tooltip|@modelcontextprotocol|pkce-challenge|ansi-styles|react-monaco-editor|msw|@bundled-es-modules|until-async|react-markdown|@ungap/structured-clone|bail|ccount|character-entities[^/\\\\]*|character-reference-invalid|comma-separated-tokens|decode-named-character-reference|devlop|escape-string-regexp|estree-util-[^/\\\\]*|hast-util-[^/\\\\]*|html-url-attributes|html-void-elements|hastscript|is-alphabetical|is-alphanumerical|is-decimal|is-hexadecimal|is-plain-obj|longest-streak|markdown-table|mdast-util-[^/\\\\]*|micromark[^/\\\\]*|parse-entities|parse5|property-information|rehype-raw|rehype-sanitize|remark-gfm|remark-parse|remark-rehype|space-separated-tokens|stringify-entities|trim-lines|trough|unified|unist-util-[^/\\\\]*|vfile[^/\\\\]*|web-namespaces|zwitch))[/\\\\].+\\.js$',
'[/\\\\]node_modules(?![\\/\\\\](byte-size|monaco-editor|monaco-yaml|monaco-promql|monaco-languageserver-types|monaco-marker-data-provider|monaco-worker-manager|vscode-languageserver-types|d3-interpolate|d3-color|date-fns|react-day-picker|langchain|langsmith|@cfworker|gpt-tokenizer|flat|@langchain|eventsource-parser|fast-check|@fast-check/jest|@assemblyscript|quickselect|rbush|zod/v4|vega-interpreter|vega-util|vega-tooltip|@modelcontextprotocol|pkce-challenge|ansi-styles|react-monaco-editor|msw|@bundled-es-modules|until-async|rettime|@open-draft/deferred-promise|react-markdown|@ungap/structured-clone|bail|ccount|character-entities[^/\\\\]*|character-reference-invalid|comma-separated-tokens|decode-named-character-reference|devlop|escape-string-regexp|estree-util-[^/\\\\]*|hast-util-[^/\\\\]*|html-url-attributes|html-void-elements|hastscript|is-alphabetical|is-alphanumerical|is-decimal|is-hexadecimal|is-plain-obj|longest-streak|markdown-table|mdast-util-[^/\\\\]*|micromark[^/\\\\]*|parse-entities|parse5|property-information|rehype-raw|rehype-sanitize|remark-gfm|remark-parse|remark-rehype|space-separated-tokens|stringify-entities|trim-lines|trough|unified|unist-util-[^/\\\\]*|vfile[^/\\\\]*|web-namespaces|zwitch))[/\\\\].+\\.m?js$',
'packages/kbn-pm/dist/index.js',
'[/\\\\]node_modules(?![\\/\\\\](langchain|langsmith|@langchain|zod/v4))/dist/[/\\\\].+\\.js$',
'[/\\\\]node_modules(?![\\/\\\\](langchain|langsmith|@langchain|zod/v4))/dist/util/[/\\\\].+\\.js$',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import type { SetupServerApi } from 'msw/node';
import type { SetupServer } from 'msw/node';
import { setupServer } from 'msw/node';
import { coreMock } from '@kbn/core/public/mocks';
import type { CoreStart } from '@kbn/core/public';
Expand Down Expand Up @@ -74,7 +74,7 @@ export const setupMockServer = ({ debug = false }: { debug?: boolean } = {}) =>
* sure we don't forget the handlers. Can easily be shared between tests.
* @param server - The MSW server instance, created with setupMockServer
*/
export const startMockServer = (server: SetupServerApi) => {
export const startMockServer = (server: SetupServer) => {
beforeAll(() => server.listen({ onUnhandledRequest: 'warn' }));
afterAll(() => server.close());
beforeEach(() => {
Expand Down
Loading
Loading