Skip to content
Draft
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: 2 additions & 0 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ Core directives for maintaining code quality and consistency in the Bitwarden iO

1. Follow existing code style in surrounding files
2. Write tests alongside implementation
1. Prefer using Sourcery with the `AutoMockable` attribute for creating mocks.
2. If a manual mock implementation is needed (not using Sourcery), place it in a `Mocks` folder within the appropriate framework directory, as our Xcodegen configuration will automatically include it in the correct test target.
Copy link
Member

Choose a reason for hiding this comment

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

๐Ÿค” I think this is true only for mocks that are for BitwardenKit or AuthenticatorBridgeKit targets. However, on other targets like BitwardenShared or AuthenticatorShared we have no Mocks folder; mocks are under TestHelpers folders and belong to their tests targets. Perhaps we should make that explicit here as well as it might create Mocks folders in those targets to follow this rule which would not be the current approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I don't love how this is phrased or implemented, especially as we do have other places we talk about mocks, and it might be better to put it all there.

Long-term, I'd like to migrate all the things into Mocks folders for consistency, though.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I agree we should have the same approach throughout the projects in the future. However for the time being I believe this should be updated with today's state of where we put mocks so Claude is not confused on where the mocks are per each target/project.

3. Add DocC to everything except protocol implementations and mocks
4. Validate against architecture guidelines

Expand Down
1 change: 1 addition & 0 deletions .claude/skills/reviewing-changes/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Systematically check each area against Bitwarden standards documented in `CLAUDE
- Unit tests for business logic and utility functions
- Snapshot/View inspector tests for user-facing features when applicable
- Test coverage for edge cases and error scenarios
- Mocks either rely on Sourcery's `AutoMockable` annotation or are in a `Mocks` folder.

5. **Security**: Given Bitwarden's security-focused nature
- Proper handling of sensitive data
Expand Down
6 changes: 3 additions & 3 deletions Docs/Architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ The iOS repository contains two main apps: Bitwarden Password Manager and Bitwar
- `BitwardenWatchShared`: Models and encoding/decoding logic for communicating between the iOS and watchOS apps.
- `Networking`: A local Swift package that implements the app's networking layer on top of `URLSession`.

### Test Helpers
### Test Helper Targets

- `GlobalTestHelpers`: Shared functionality between the app's test targets.
- `BitwardenKitMocks`: Mock implementations for BitwardenKit components.
- `AuthenticatorBridgeKitMocks`: Mock implementations for AuthenticatorBridgeKit components.
- `BitwardenKitMocks`: Mock implementations for BitwardenKit components. Files placed in a `Mocks` folder in `BitwardenKit` will be automatically included in this target.
- `AuthenticatorBridgeKitMocks`: Mock implementations for AuthenticatorBridgeKit components. Files placed in a `Mocks` folder in `AuthenticatorBridgeKit` will be automatically included in this target.
- `TestHelpers`: Additional test utilities and helpers.
- `ViewInspectorTestHelpers`: ViewInspector-specific test helpers for UI testing.

Expand Down