Skip to content

[@kbn/scout-{oblt,search,security}] Update Solutions API tests to use API expect#250772

Merged
steliosmavro merged 2 commits intoelastic:mainfrom
steliosmavro:api-expect-for-solutions
Jan 29, 2026
Merged

[@kbn/scout-{oblt,search,security}] Update Solutions API tests to use API expect#250772
steliosmavro merged 2 commits intoelastic:mainfrom
steliosmavro:api-expect-for-solutions

Conversation

@steliosmavro
Copy link
Copy Markdown
Contributor

@steliosmavro steliosmavro commented Jan 28, 2026

Summary

Updates Solutions API tests to use the dedicated API expect from @kbn/scout/api and adds an ESLint rule to enforce correct import paths.

Changes

  • Added api.ts exports for @kbn/scout-oblt, @kbn/scout-search, and @kbn/scout-security packages
  • Updated solutions API tests to import expect from @kbn/scout-oblt/api
  • Changed assertions from toBeTruthy()/toBeFalsy() to explicit toBe(true)/toBe(false)
  • Refactored stack trace handling to use native Error.captureStackTrace instead of manually filtering stack lines
  • Added ESLint rule scout_expect_import to validate expect imports based on test type (api/ui)

@steliosmavro steliosmavro self-assigned this Jan 28, 2026
@steliosmavro steliosmavro requested review from a team as code owners January 28, 2026 16:59
@steliosmavro steliosmavro added release_note:skip Skip the PR/issue when compiling release notes backport:all-open Backport to all branches that could still receive a release test:scout labels Jan 28, 2026
@steliosmavro steliosmavro requested a review from a team as a code owner January 28, 2026 18:39
Copy link
Copy Markdown
Contributor

@mistic mistic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes on filed owned by Operations team LGTM

Copy link
Copy Markdown
Contributor

@smith smith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Profiling test changes look ok.

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

cc @steliosmavro

@steliosmavro steliosmavro changed the title Update Solutions API tests to use API expect [@kbn/scout-{oblt,search,security}] Update Solutions API tests to use API expect Jan 29, 2026
Comment on lines +46 to 60
export function wrapMatcher<TArgs extends unknown[], TReturn>(
fn: (...args: TArgs) => TReturn
): (...args: TArgs) => TReturn {
const wrapper = (...args: TArgs): TReturn => {
try {
return fn(...args);
} catch (error) {
if (error instanceof Error) {
Error.captureStackTrace(error, wrapper);
}
throw error;
}
};
return wrapper;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice addtion! can you post here the stacktrace example?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, here is an example for both a custom response matcher and a native playwright value matcher:

Screenshot 2026-01-29 at 12 19 47 PM

Error.captureStackTrace is a V8 native method for capturing a stack trace, allowing to filter stack lines instead of manually manipulating Error.stack.

@dmlemeshko dmlemeshko self-requested a review January 29, 2026 11:16
@steliosmavro steliosmavro merged commit 96d91d8 into elastic:main Jan 29, 2026
16 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19, 9.1, 9.2, 9.3

https://github.com/elastic/kibana/actions/runs/21476317009

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 29, 2026
… API `expect` (elastic#250772)

## Summary

Updates Solutions API tests to use the dedicated API `expect` from
`@kbn/scout/api` and adds an ESLint rule to enforce correct import
paths.

### Changes

- Added `api.ts` exports for `@kbn/scout-oblt`, `@kbn/scout-search`, and
`@kbn/scout-security` packages
- Updated solutions API tests to import `expect` from
`@kbn/scout-oblt/api`
- Changed assertions from `toBeTruthy()`/`toBeFalsy()` to explicit
`toBe(true)`/`toBe(false)`
- Refactored stack trace handling to use native
`Error.captureStackTrace` instead of manually filtering stack lines
- Added ESLint rule `scout_expect_import` to validate `expect` imports
based on test type (api/ui)

(cherry picked from commit 96d91d8)
@kibanamachine
Copy link
Copy Markdown
Contributor

💔 Some backports could not be created

Status Branch Result
8.19 Backport failed because of merge conflicts
9.1 Backport failed because of merge conflicts

You might need to backport the following PRs to 9.1:
- [OpenAPI] Do not generate imports for local references (#250723)
9.2 Backport failed because of merge conflicts
9.3

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 250772

Questions ?

Please refer to the Backport tool documentation

steliosmavro added a commit to steliosmavro/kibana that referenced this pull request Jan 29, 2026
… API `expect` (elastic#250772)

## Summary

Updates Solutions API tests to use the dedicated API `expect` from
`@kbn/scout/api` and adds an ESLint rule to enforce correct import
paths.

### Changes

- Added `api.ts` exports for `@kbn/scout-oblt`, `@kbn/scout-search`, and
`@kbn/scout-security` packages
- Updated solutions API tests to import `expect` from
`@kbn/scout-oblt/api`
- Changed assertions from `toBeTruthy()`/`toBeFalsy()` to explicit
`toBe(true)`/`toBe(false)`
- Refactored stack trace handling to use native
`Error.captureStackTrace` instead of manually filtering stack lines
- Added ESLint rule `scout_expect_import` to validate `expect` imports
based on test type (api/ui)

(cherry picked from commit 96d91d8)
steliosmavro added a commit to steliosmavro/kibana that referenced this pull request Jan 29, 2026
… API `expect` (elastic#250772)

## Summary

Updates Solutions API tests to use the dedicated API `expect` from
`@kbn/scout/api` and adds an ESLint rule to enforce correct import
paths.

### Changes

- Added `api.ts` exports for `@kbn/scout-oblt`, `@kbn/scout-search`, and
`@kbn/scout-security` packages
- Updated solutions API tests to import `expect` from
`@kbn/scout-oblt/api`
- Changed assertions from `toBeTruthy()`/`toBeFalsy()` to explicit
`toBe(true)`/`toBe(false)`
- Refactored stack trace handling to use native
`Error.captureStackTrace` instead of manually filtering stack lines
- Added ESLint rule `scout_expect_import` to validate `expect` imports
based on test type (api/ui)

(cherry picked from commit 96d91d8)

# Conflicts:
#	x-pack/solutions/observability/plugins/profiling/test/scout/api/tests/has_no_setup.spec.ts
#	x-pack/solutions/observability/plugins/profiling/test/scout/api/tests/has_setup_apm_not_installed.spec.ts
#	x-pack/solutions/observability/plugins/profiling/test/scout/api/tests/has_setup_with_data.spec.ts
#	x-pack/solutions/observability/plugins/profiling/test/scout/api/tests/has_setup_with_integrations.spec.ts
steliosmavro added a commit to steliosmavro/kibana that referenced this pull request Jan 29, 2026
… API `expect` (elastic#250772)

## Summary

Updates Solutions API tests to use the dedicated API `expect` from
`@kbn/scout/api` and adds an ESLint rule to enforce correct import
paths.

### Changes

- Added `api.ts` exports for `@kbn/scout-oblt`, `@kbn/scout-search`, and
`@kbn/scout-security` packages
- Updated solutions API tests to import `expect` from
`@kbn/scout-oblt/api`
- Changed assertions from `toBeTruthy()`/`toBeFalsy()` to explicit
`toBe(true)`/`toBe(false)`
- Refactored stack trace handling to use native
`Error.captureStackTrace` instead of manually filtering stack lines
- Added ESLint rule `scout_expect_import` to validate `expect` imports
based on test type (api/ui)

(cherry picked from commit 96d91d8)

# Conflicts:
#	x-pack/solutions/observability/plugins/profiling/test/scout/api/tests/has_no_setup.spec.ts
#	x-pack/solutions/observability/plugins/profiling/test/scout/api/tests/has_setup_apm_not_installed.spec.ts
#	x-pack/solutions/observability/plugins/profiling/test/scout/api/tests/has_setup_with_data.spec.ts
#	x-pack/solutions/observability/plugins/profiling/test/scout/api/tests/has_setup_with_integrations.spec.ts
@steliosmavro
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
9.3
9.2
9.1
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

steliosmavro added a commit to steliosmavro/kibana that referenced this pull request Jan 29, 2026
… API `expect` (elastic#250772)

## Summary

Updates Solutions API tests to use the dedicated API `expect` from
`@kbn/scout/api` and adds an ESLint rule to enforce correct import
paths.

### Changes

- Added `api.ts` exports for `@kbn/scout-oblt`, `@kbn/scout-search`, and
`@kbn/scout-security` packages
- Updated solutions API tests to import `expect` from
`@kbn/scout-oblt/api`
- Changed assertions from `toBeTruthy()`/`toBeFalsy()` to explicit
`toBe(true)`/`toBe(false)`
- Refactored stack trace handling to use native
`Error.captureStackTrace` instead of manually filtering stack lines
- Added ESLint rule `scout_expect_import` to validate `expect` imports
based on test type (api/ui)

(cherry picked from commit 96d91d8)

# Conflicts:
#	.eslintrc.js
#	x-pack/solutions/observability/plugins/profiling/test/scout/api/tests/has_no_setup.spec.ts
#	x-pack/solutions/observability/plugins/profiling/test/scout/api/tests/has_setup_apm_not_installed.spec.ts
#	x-pack/solutions/observability/plugins/profiling/test/scout/api/tests/has_setup_with_data.spec.ts
#	x-pack/solutions/observability/plugins/profiling/test/scout/api/tests/has_setup_with_integrations.spec.ts
@delanni delanni mentioned this pull request Jan 29, 2026
delanni added a commit that referenced this pull request Jan 29, 2026
## Summary
A combination of #250566 +
#250772 caused a lint issue, then
an import issue on main.
kibanamachine added a commit that referenced this pull request Jan 29, 2026
…to use API `expect` (#250772) (#250877)

# Backport

This will backport the following commits from `main` to `9.3`:
- [[@kbn/scout-{oblt,search,security}] Update Solutions API tests to use
API `expect` (#250772)](#250772)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Stelios
Mavro","email":"81311181+steliosmavro@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-01-29T11:25:37Z","message":"[@kbn/scout-{oblt,search,security}]
Update Solutions API tests to use API `expect` (#250772)\n\n##
Summary\n\nUpdates Solutions API tests to use the dedicated API `expect`
from\n`@kbn/scout/api` and adds an ESLint rule to enforce correct
import\npaths.\n\n### Changes\n\n- Added `api.ts` exports for
`@kbn/scout-oblt`, `@kbn/scout-search`, and\n`@kbn/scout-security`
packages\n- Updated solutions API tests to import `expect`
from\n`@kbn/scout-oblt/api`\n- Changed assertions from
`toBeTruthy()`/`toBeFalsy()` to explicit\n`toBe(true)`/`toBe(false)`\n-
Refactored stack trace handling to use native\n`Error.captureStackTrace`
instead of manually filtering stack lines\n- Added ESLint rule
`scout_expect_import` to validate `expect` imports\nbased on test type
(api/ui)","sha":"96d91d8d67257f7cddcc67fa861c0fd5a27b942c","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","test:scout","v9.4.0"],"title":"[@kbn/scout-{oblt,search,security}]
Update Solutions API tests to use API
`expect`","number":250772,"url":"https://github.com/elastic/kibana/pull/250772","mergeCommit":{"message":"[@kbn/scout-{oblt,search,security}]
Update Solutions API tests to use API `expect` (#250772)\n\n##
Summary\n\nUpdates Solutions API tests to use the dedicated API `expect`
from\n`@kbn/scout/api` and adds an ESLint rule to enforce correct
import\npaths.\n\n### Changes\n\n- Added `api.ts` exports for
`@kbn/scout-oblt`, `@kbn/scout-search`, and\n`@kbn/scout-security`
packages\n- Updated solutions API tests to import `expect`
from\n`@kbn/scout-oblt/api`\n- Changed assertions from
`toBeTruthy()`/`toBeFalsy()` to explicit\n`toBe(true)`/`toBe(false)`\n-
Refactored stack trace handling to use native\n`Error.captureStackTrace`
instead of manually filtering stack lines\n- Added ESLint rule
`scout_expect_import` to validate `expect` imports\nbased on test type
(api/ui)","sha":"96d91d8d67257f7cddcc67fa861c0fd5a27b942c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/250772","number":250772,"mergeCommit":{"message":"[@kbn/scout-{oblt,search,security}]
Update Solutions API tests to use API `expect` (#250772)\n\n##
Summary\n\nUpdates Solutions API tests to use the dedicated API `expect`
from\n`@kbn/scout/api` and adds an ESLint rule to enforce correct
import\npaths.\n\n### Changes\n\n- Added `api.ts` exports for
`@kbn/scout-oblt`, `@kbn/scout-search`, and\n`@kbn/scout-security`
packages\n- Updated solutions API tests to import `expect`
from\n`@kbn/scout-oblt/api`\n- Changed assertions from
`toBeTruthy()`/`toBeFalsy()` to explicit\n`toBe(true)`/`toBe(false)`\n-
Refactored stack trace handling to use native\n`Error.captureStackTrace`
instead of manually filtering stack lines\n- Added ESLint rule
`scout_expect_import` to validate `expect` imports\nbased on test type
(api/ui)","sha":"96d91d8d67257f7cddcc67fa861c0fd5a27b942c"}}]}]
BACKPORT-->

Co-authored-by: Stelios Mavro <81311181+steliosmavro@users.noreply.github.com>
steliosmavro added a commit that referenced this pull request Jan 30, 2026
…to use API `expect` (#250772) (#250879)

# Backport

This will backport the following commits from `main` to `9.2`:
- [[@kbn/scout-{oblt,search,security}] Update Solutions API tests to use
API `expect` (#250772)](#250772)

<!--- Backport version: 10.2.0 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Stelios
Mavro","email":"81311181+steliosmavro@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-01-29T11:25:37Z","message":"[@kbn/scout-{oblt,search,security}]
Update Solutions API tests to use API `expect` (#250772)\n\n##
Summary\n\nUpdates Solutions API tests to use the dedicated API `expect`
from\n`@kbn/scout/api` and adds an ESLint rule to enforce correct
import\npaths.\n\n### Changes\n\n- Added `api.ts` exports for
`@kbn/scout-oblt`, `@kbn/scout-search`, and\n`@kbn/scout-security`
packages\n- Updated solutions API tests to import `expect`
from\n`@kbn/scout-oblt/api`\n- Changed assertions from
`toBeTruthy()`/`toBeFalsy()` to explicit\n`toBe(true)`/`toBe(false)`\n-
Refactored stack trace handling to use native\n`Error.captureStackTrace`
instead of manually filtering stack lines\n- Added ESLint rule
`scout_expect_import` to validate `expect` imports\nbased on test type
(api/ui)","sha":"96d91d8d67257f7cddcc67fa861c0fd5a27b942c","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","test:scout","v9.4.0"],"title":"[@kbn/scout-{oblt,search,security}]
Update Solutions API tests to use API
`expect`","number":250772,"url":"https://github.com/elastic/kibana/pull/250772","mergeCommit":{"message":"[@kbn/scout-{oblt,search,security}]
Update Solutions API tests to use API `expect` (#250772)\n\n##
Summary\n\nUpdates Solutions API tests to use the dedicated API `expect`
from\n`@kbn/scout/api` and adds an ESLint rule to enforce correct
import\npaths.\n\n### Changes\n\n- Added `api.ts` exports for
`@kbn/scout-oblt`, `@kbn/scout-search`, and\n`@kbn/scout-security`
packages\n- Updated solutions API tests to import `expect`
from\n`@kbn/scout-oblt/api`\n- Changed assertions from
`toBeTruthy()`/`toBeFalsy()` to explicit\n`toBe(true)`/`toBe(false)`\n-
Refactored stack trace handling to use native\n`Error.captureStackTrace`
instead of manually filtering stack lines\n- Added ESLint rule
`scout_expect_import` to validate `expect` imports\nbased on test type
(api/ui)","sha":"96d91d8d67257f7cddcc67fa861c0fd5a27b942c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/250772","number":250772,"mergeCommit":{"message":"[@kbn/scout-{oblt,search,security}]
Update Solutions API tests to use API `expect` (#250772)\n\n##
Summary\n\nUpdates Solutions API tests to use the dedicated API `expect`
from\n`@kbn/scout/api` and adds an ESLint rule to enforce correct
import\npaths.\n\n### Changes\n\n- Added `api.ts` exports for
`@kbn/scout-oblt`, `@kbn/scout-search`, and\n`@kbn/scout-security`
packages\n- Updated solutions API tests to import `expect`
from\n`@kbn/scout-oblt/api`\n- Changed assertions from
`toBeTruthy()`/`toBeFalsy()` to explicit\n`toBe(true)`/`toBe(false)`\n-
Refactored stack trace handling to use native\n`Error.captureStackTrace`
instead of manually filtering stack lines\n- Added ESLint rule
`scout_expect_import` to validate `expect` imports\nbased on test type
(api/ui)","sha":"96d91d8d67257f7cddcc67fa861c0fd5a27b942c"}},{"url":"https://github.com/elastic/kibana/pull/250877","number":250877,"branch":"9.3","state":"OPEN"}]}]
BACKPORT-->
steliosmavro added a commit that referenced this pull request Jan 30, 2026
…to use API `expect` (#250772) (#250878)

# Backport

This will backport the following commits from `main` to `9.3`:
- [[@kbn/scout-{oblt,search,security}] Update Solutions API tests to use
API `expect` (#250772)](#250772)

<!--- Backport version: 10.2.0 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Stelios
Mavro","email":"81311181+steliosmavro@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-01-29T11:25:37Z","message":"[@kbn/scout-{oblt,search,security}]
Update Solutions API tests to use API `expect` (#250772)\n\n##
Summary\n\nUpdates Solutions API tests to use the dedicated API `expect`
from\n`@kbn/scout/api` and adds an ESLint rule to enforce correct
import\npaths.\n\n### Changes\n\n- Added `api.ts` exports for
`@kbn/scout-oblt`, `@kbn/scout-search`, and\n`@kbn/scout-security`
packages\n- Updated solutions API tests to import `expect`
from\n`@kbn/scout-oblt/api`\n- Changed assertions from
`toBeTruthy()`/`toBeFalsy()` to explicit\n`toBe(true)`/`toBe(false)`\n-
Refactored stack trace handling to use native\n`Error.captureStackTrace`
instead of manually filtering stack lines\n- Added ESLint rule
`scout_expect_import` to validate `expect` imports\nbased on test type
(api/ui)","sha":"96d91d8d67257f7cddcc67fa861c0fd5a27b942c","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","test:scout","v9.4.0"],"title":"[@kbn/scout-{oblt,search,security}]
Update Solutions API tests to use API
`expect`","number":250772,"url":"https://github.com/elastic/kibana/pull/250772","mergeCommit":{"message":"[@kbn/scout-{oblt,search,security}]
Update Solutions API tests to use API `expect` (#250772)\n\n##
Summary\n\nUpdates Solutions API tests to use the dedicated API `expect`
from\n`@kbn/scout/api` and adds an ESLint rule to enforce correct
import\npaths.\n\n### Changes\n\n- Added `api.ts` exports for
`@kbn/scout-oblt`, `@kbn/scout-search`, and\n`@kbn/scout-security`
packages\n- Updated solutions API tests to import `expect`
from\n`@kbn/scout-oblt/api`\n- Changed assertions from
`toBeTruthy()`/`toBeFalsy()` to explicit\n`toBe(true)`/`toBe(false)`\n-
Refactored stack trace handling to use native\n`Error.captureStackTrace`
instead of manually filtering stack lines\n- Added ESLint rule
`scout_expect_import` to validate `expect` imports\nbased on test type
(api/ui)","sha":"96d91d8d67257f7cddcc67fa861c0fd5a27b942c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/250772","number":250772,"mergeCommit":{"message":"[@kbn/scout-{oblt,search,security}]
Update Solutions API tests to use API `expect` (#250772)\n\n##
Summary\n\nUpdates Solutions API tests to use the dedicated API `expect`
from\n`@kbn/scout/api` and adds an ESLint rule to enforce correct
import\npaths.\n\n### Changes\n\n- Added `api.ts` exports for
`@kbn/scout-oblt`, `@kbn/scout-search`, and\n`@kbn/scout-security`
packages\n- Updated solutions API tests to import `expect`
from\n`@kbn/scout-oblt/api`\n- Changed assertions from
`toBeTruthy()`/`toBeFalsy()` to explicit\n`toBe(true)`/`toBe(false)`\n-
Refactored stack trace handling to use native\n`Error.captureStackTrace`
instead of manually filtering stack lines\n- Added ESLint rule
`scout_expect_import` to validate `expect` imports\nbased on test type
(api/ui)","sha":"96d91d8d67257f7cddcc67fa861c0fd5a27b942c"}},{"url":"https://github.com/elastic/kibana/pull/250877","number":250877,"branch":"9.3","state":"OPEN"}]}]
BACKPORT-->
steliosmavro added a commit that referenced this pull request Jan 30, 2026
…to use API `expect` (#250772) (#250880)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[@kbn/scout-{oblt,search,security}] Update Solutions API tests to use
API `expect` (#250772)](#250772)

<!--- Backport version: 10.2.0 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Stelios
Mavro","email":"81311181+steliosmavro@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-01-29T11:25:37Z","message":"[@kbn/scout-{oblt,search,security}]
Update Solutions API tests to use API `expect` (#250772)\n\n##
Summary\n\nUpdates Solutions API tests to use the dedicated API `expect`
from\n`@kbn/scout/api` and adds an ESLint rule to enforce correct
import\npaths.\n\n### Changes\n\n- Added `api.ts` exports for
`@kbn/scout-oblt`, `@kbn/scout-search`, and\n`@kbn/scout-security`
packages\n- Updated solutions API tests to import `expect`
from\n`@kbn/scout-oblt/api`\n- Changed assertions from
`toBeTruthy()`/`toBeFalsy()` to explicit\n`toBe(true)`/`toBe(false)`\n-
Refactored stack trace handling to use native\n`Error.captureStackTrace`
instead of manually filtering stack lines\n- Added ESLint rule
`scout_expect_import` to validate `expect` imports\nbased on test type
(api/ui)","sha":"96d91d8d67257f7cddcc67fa861c0fd5a27b942c","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","test:scout","v9.4.0"],"title":"[@kbn/scout-{oblt,search,security}]
Update Solutions API tests to use API
`expect`","number":250772,"url":"https://github.com/elastic/kibana/pull/250772","mergeCommit":{"message":"[@kbn/scout-{oblt,search,security}]
Update Solutions API tests to use API `expect` (#250772)\n\n##
Summary\n\nUpdates Solutions API tests to use the dedicated API `expect`
from\n`@kbn/scout/api` and adds an ESLint rule to enforce correct
import\npaths.\n\n### Changes\n\n- Added `api.ts` exports for
`@kbn/scout-oblt`, `@kbn/scout-search`, and\n`@kbn/scout-security`
packages\n- Updated solutions API tests to import `expect`
from\n`@kbn/scout-oblt/api`\n- Changed assertions from
`toBeTruthy()`/`toBeFalsy()` to explicit\n`toBe(true)`/`toBe(false)`\n-
Refactored stack trace handling to use native\n`Error.captureStackTrace`
instead of manually filtering stack lines\n- Added ESLint rule
`scout_expect_import` to validate `expect` imports\nbased on test type
(api/ui)","sha":"96d91d8d67257f7cddcc67fa861c0fd5a27b942c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/250772","number":250772,"mergeCommit":{"message":"[@kbn/scout-{oblt,search,security}]
Update Solutions API tests to use API `expect` (#250772)\n\n##
Summary\n\nUpdates Solutions API tests to use the dedicated API `expect`
from\n`@kbn/scout/api` and adds an ESLint rule to enforce correct
import\npaths.\n\n### Changes\n\n- Added `api.ts` exports for
`@kbn/scout-oblt`, `@kbn/scout-search`, and\n`@kbn/scout-security`
packages\n- Updated solutions API tests to import `expect`
from\n`@kbn/scout-oblt/api`\n- Changed assertions from
`toBeTruthy()`/`toBeFalsy()` to explicit\n`toBe(true)`/`toBe(false)`\n-
Refactored stack trace handling to use native\n`Error.captureStackTrace`
instead of manually filtering stack lines\n- Added ESLint rule
`scout_expect_import` to validate `expect` imports\nbased on test type
(api/ui)","sha":"96d91d8d67257f7cddcc67fa861c0fd5a27b942c"}},{"url":"https://github.com/elastic/kibana/pull/250877","number":250877,"branch":"9.3","state":"OPEN"}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
steliosmavro added a commit that referenced this pull request Jan 30, 2026
… to use API `expect` (#250772) (#250881)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[@kbn/scout-{oblt,search,security}] Update Solutions API tests to use
API `expect` (#250772)](#250772)

<!--- Backport version: 10.2.0 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Stelios
Mavro","email":"81311181+steliosmavro@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-01-29T11:25:37Z","message":"[@kbn/scout-{oblt,search,security}]
Update Solutions API tests to use API `expect` (#250772)\n\n##
Summary\n\nUpdates Solutions API tests to use the dedicated API `expect`
from\n`@kbn/scout/api` and adds an ESLint rule to enforce correct
import\npaths.\n\n### Changes\n\n- Added `api.ts` exports for
`@kbn/scout-oblt`, `@kbn/scout-search`, and\n`@kbn/scout-security`
packages\n- Updated solutions API tests to import `expect`
from\n`@kbn/scout-oblt/api`\n- Changed assertions from
`toBeTruthy()`/`toBeFalsy()` to explicit\n`toBe(true)`/`toBe(false)`\n-
Refactored stack trace handling to use native\n`Error.captureStackTrace`
instead of manually filtering stack lines\n- Added ESLint rule
`scout_expect_import` to validate `expect` imports\nbased on test type
(api/ui)","sha":"96d91d8d67257f7cddcc67fa861c0fd5a27b942c","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","test:scout","v9.4.0"],"title":"[@kbn/scout-{oblt,search,security}]
Update Solutions API tests to use API
`expect`","number":250772,"url":"https://github.com/elastic/kibana/pull/250772","mergeCommit":{"message":"[@kbn/scout-{oblt,search,security}]
Update Solutions API tests to use API `expect` (#250772)\n\n##
Summary\n\nUpdates Solutions API tests to use the dedicated API `expect`
from\n`@kbn/scout/api` and adds an ESLint rule to enforce correct
import\npaths.\n\n### Changes\n\n- Added `api.ts` exports for
`@kbn/scout-oblt`, `@kbn/scout-search`, and\n`@kbn/scout-security`
packages\n- Updated solutions API tests to import `expect`
from\n`@kbn/scout-oblt/api`\n- Changed assertions from
`toBeTruthy()`/`toBeFalsy()` to explicit\n`toBe(true)`/`toBe(false)`\n-
Refactored stack trace handling to use native\n`Error.captureStackTrace`
instead of manually filtering stack lines\n- Added ESLint rule
`scout_expect_import` to validate `expect` imports\nbased on test type
(api/ui)","sha":"96d91d8d67257f7cddcc67fa861c0fd5a27b942c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/250772","number":250772,"mergeCommit":{"message":"[@kbn/scout-{oblt,search,security}]
Update Solutions API tests to use API `expect` (#250772)\n\n##
Summary\n\nUpdates Solutions API tests to use the dedicated API `expect`
from\n`@kbn/scout/api` and adds an ESLint rule to enforce correct
import\npaths.\n\n### Changes\n\n- Added `api.ts` exports for
`@kbn/scout-oblt`, `@kbn/scout-search`, and\n`@kbn/scout-security`
packages\n- Updated solutions API tests to import `expect`
from\n`@kbn/scout-oblt/api`\n- Changed assertions from
`toBeTruthy()`/`toBeFalsy()` to explicit\n`toBe(true)`/`toBe(false)`\n-
Refactored stack trace handling to use native\n`Error.captureStackTrace`
instead of manually filtering stack lines\n- Added ESLint rule
`scout_expect_import` to validate `expect` imports\nbased on test type
(api/ui)","sha":"96d91d8d67257f7cddcc67fa861c0fd5a27b942c"}},{"url":"https://github.com/elastic/kibana/pull/250877","number":250877,"branch":"9.3","state":"OPEN"}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
hannahbrooks pushed a commit to hannahbrooks/kibana that referenced this pull request Jan 30, 2026
… API `expect` (elastic#250772)

## Summary

Updates Solutions API tests to use the dedicated API `expect` from
`@kbn/scout/api` and adds an ESLint rule to enforce correct import
paths.

### Changes

- Added `api.ts` exports for `@kbn/scout-oblt`, `@kbn/scout-search`, and
`@kbn/scout-security` packages
- Updated solutions API tests to import `expect` from
`@kbn/scout-oblt/api`
- Changed assertions from `toBeTruthy()`/`toBeFalsy()` to explicit
`toBe(true)`/`toBe(false)`
- Refactored stack trace handling to use native
`Error.captureStackTrace` instead of manually filtering stack lines
- Added ESLint rule `scout_expect_import` to validate `expect` imports
based on test type (api/ui)
hannahbrooks pushed a commit to hannahbrooks/kibana that referenced this pull request Jan 30, 2026
## Summary
A combination of elastic#250566 +
elastic#250772 caused a lint issue, then
an import issue on main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:all-open Backport to all branches that could still receive a release release_note:skip Skip the PR/issue when compiling release notes test:scout v8.19.11 v9.1.11 v9.2.5 v9.3.0 v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants