---
title: "Test(_:_:)"
framework: testing
role: symbol
role_heading: Macro
path: "testing/test(_:_:)"
---

# Test(_:_:)

Declare a test.

## Declaration

```swift
@attached(peer) macro Test(_ displayName: String? = nil, _ traits: any TestTrait...)
```

## Parameters

- `displayName`: The customized display name of this test. If the value of this argument is nil, the display name of the test is derived from the associated function’s name.
- `traits`: Zero or more traits to apply to this test.

## See Also

### Related Documentation

- [Defining test functions](testing/definingtests.md)

### Essentials

- [Defining test functions](testing/definingtests.md)
- [Organizing test functions with suite types](testing/organizingtests.md)
- [Migrating a test from XCTest](testing/migratingfromxctest.md)
- [Test](testing/test.md)
- [Suite(_:_:)](testing/suite(_:_:).md)
