Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tahirmt
Copy link
Contributor

@tahirmt tahirmt commented Jul 26, 2023

The @TestState property wrapper was reintroduced in #1233. It currently requires initial value in the wrapper to be passed in but we can't use the assignment operator. By adding the expected initializer for propertyWrapper we can support just initializing naturally. Even support type inference.

Before

describe("something") {
    @TestState(123) var state: Int! 
}

After

describe("something") {
    @TestState var state = 123
}

This change is non-breaking and does not change the existing behavior.

Checklist - While not every PR needs it, new features should consider this list:

  • Does this have tests?
  • Does this have documentation?
  • Does this break the public API (Requires major version bump)? - No
  • Is this a new feature (Requires minor version bump)? - No

Copy link
Member

@younata younata left a comment

Choose a reason for hiding this comment

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

Omg, I'm so sorry for forgetting about this until now. This is great, thank you so much!

@younata younata enabled auto-merge August 28, 2023 17:12
@younata younata merged commit b96f6f1 into Quick:main Aug 28, 2023
cgrindel-self-hosted-renovate bot referenced this pull request in cgrindel/rules_swift_package_manager Sep 18, 2023
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [Quick/Quick](https://togithub.com/Quick/Quick) | minor | `from:
"7.2.0"` -> `from: "7.3.0"` |

---

### Release Notes

<details>
<summary>Quick/Quick (Quick/Quick)</summary>

### [`v7.3.0`](https://togithub.com/Quick/Quick/releases/tag/v7.3.0)

[Compare
Source](https://togithub.com/Quick/Quick/compare/v7.2.0...v7.3.0)

#### Highlights

- Adds a property wrapper default initializer for TestState. Meaning the
following declaration is now accepted!

```swift
@&#8203;TestState var foo: Int! = 30
```

Thanks [@&#8203;tahirmt](https://togithub.com/tahirmt)!

- TestState now nils out the value after all afterEach blocks run,
instead of in the middle of the afterEach chain. Thanks
[@&#8203;CraigSiemens](https://togithub.com/CraigSiemens)

#### What's Changed

- Bump activesupport from 7.0.4.3 to 7.0.7.2 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/Quick/Quick/pull/1238](https://togithub.com/Quick/Quick/pull/1238)
- Add property wrapper default initializer for TestState by
[@&#8203;tahirmt](https://togithub.com/tahirmt) in
[https://github.com/Quick/Quick/pull/1235](https://togithub.com/Quick/Quick/pull/1235)
- Bump actions/checkout from 3 to 4 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/Quick/Quick/pull/1241](https://togithub.com/Quick/Quick/pull/1241)
- Updated TestState to remove the value after the test. by
[@&#8203;CraigSiemens](https://togithub.com/CraigSiemens) in
[https://github.com/Quick/Quick/pull/1240](https://togithub.com/Quick/Quick/pull/1240)
- Update release script to generate a carthage binary and include it in
the release. by [@&#8203;younata](https://togithub.com/younata) in
[https://github.com/Quick/Quick/pull/1234](https://togithub.com/Quick/Quick/pull/1234)

#### New Contributors

- [@&#8203;tahirmt](https://togithub.com/tahirmt) made their first
contribution in
[https://github.com/Quick/Quick/pull/1235](https://togithub.com/Quick/Quick/pull/1235)

**Full Changelog**:
Quick/Quick@v7.2.0...v7.3.0

</details>

---

### Configuration

πŸ“… **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

β™» **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

πŸ‘» **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi45Ni4wIiwidXBkYXRlZEluVmVyIjoiMzYuOTYuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: Self-hosted Renovate Bot <361546+cgrindel-self-hosted-renovate[bot]@users.noreply.github.enterprise.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants