Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3
The snapshot testing library for GRDB
License
NotificationsYou must be signed in to change notification settings
groue/GRDBSnapshotTesting
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
The snapshot testing library for GRDB
Requirements: iOS 13.0+ / macOS 10.15+ / tvOS 13.0+ / watchOS 7.0+ • Swift 6+ / Xcode 16+
This package makes it possible to testGRDB databases withSnapshotTesting.
See theDocumentation for usage tips and case studies (testing a fresh install, testing a specific migration, etc).
import GRDBimport GRDBSnapshotTestingimport InlineSnapshotTestingimport XCTestclassMyDatabaseTests:XCTestCase{func test_full_database_content()throws{letdbQueue=trymakeMyDatabase()assertInlineSnapshot(of: dbQueue, as:.dumpContent()){""" sqlite_master CREATE TABLE player ( id INTEGER PRIMARY KEY, name TEXT NOT NULL, score INTEGER NOT NULL); player - id: 1 name: 'Arthur' score: 500 - id: 2 name: 'Barbara' score: 1000"""}}func test_tables()throws{letdbQueue=trymakeMyDatabase()assertSnapshot(of: dbQueue, as:.dumpTables(["player","team"]))}func test_request()throws{letdbQueue=trymakeMyDatabase()try dbQueue.read{ dbinassertSnapshot(of:Player.all(), as:.dump(db))}}func test_sql()throws{letdbQueue=trymakeMyDatabase()try dbQueue.read{ dbinassertSnapshot(of:"SELECT * FROM player ORDER BY id", as:.dump(db))}}}
About
The snapshot testing library for GRDB
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.