<!--
{
  "availability" : [
    "iOS: 27.3.0 -",
    "iPadOS: 27.3.0 -",
    "macCatalyst: 27.3.0 -",
    "macOS: 27.3.0 -",
    "tvOS: 27.3.0 -",
    "visionOS: 27.3.0 -",
    "watchOS: 27.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntentsTesting",
  "identifier" : "/documentation/AppIntentsTesting/AppIntentDefinition/result(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "App Intents Testing",
      "AppIntentsTesting"
    ],
    "preciseIdentifier" : "s:17AppIntentsTesting0A16IntentDefinitionV6resultyAA0aD11ExpectationVAA0d5ValueG0_pF"
  },
  "title" : "result(_:)"
}
-->

# result(_:)

Creates an intent expectation that checks the result the intent returns,
but none of its parameters.

```
func result(_ resultExpectation: any IntentValueExpectation) -> AppIntentExpectation
```

## Parameters

`resultExpectation`

The value expectation for the intent’s
result, such as an [`AppEntityExpectation`](/documentation/AppIntentsTesting/AppEntityExpectation). Pass
[`isNil`](/documentation/AppIntentsTesting/IntentValueExpectation/isNil) to expect no result.

## Return Value

An intent expectation that checks only the intent’s result.

## Discussion

To check the result, perform the intent and pass both the intent and
its result to [`isSatisfied(by:result:)`](/documentation/AppIntentsTesting/AppIntentExpectationProviding/isSatisfied(by:result:)).
If you omit the result, the framework treats the intent as returning no
value. For example:

```swift
let createEventIntentDefinition = definitions.intents["CreateEventIntent"]
let intent = createEventIntentDefinition.makeIntent(title: "NASA launch")
let result = try await intent.run()

let expectation = createEventIntentDefinition.result(.notNil)
let isSatisfied = try await expectation.isSatisfied(
    by: intent,
    result: result
)
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)