Clarify testing commands in `CONTRIBUTING.md` (#488)

This should help new contributors to run the test suite locally.
This commit is contained in:
Max Desiatov 2022-05-24 15:42:31 +01:00 committed by GitHub
parent a604ef5269
commit c0c4534352
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -29,6 +29,19 @@ only `TokamakStaticHTML`, single-page apps would use `TokamakDOM`, maybe in conj
Android at some point, probably in a separate `TokamakAndroid` module, Android apps would use
`TokamakAndroid` with no need to be aware of any of the web modules.
### Testing
Tokamak uses [SnapshotTesting](https://github.com/pointfreeco/swift-snapshot-testing) library to
make sure that HTML and layout generated by renderers stay consistent. To run the test suite on macOS
you should use this command:
```sh
swift build --product TokamakPackageTests && `xcrun --find xctest` .build/debug/TokamakPackageTests.xctest
```
Unfortunately, plain `swift test` won't work as it tries to build targets that aren't related to
the test suite.
### Coding Style
This project uses [SwiftFormat](https://github.com/nicklockwood/SwiftFormat) and