feat: Adds script to generate database seeded values and removes old mock storage.
This commit is contained in:
@@ -84,12 +84,18 @@ public extension User {
|
||||
|
||||
}
|
||||
|
||||
// public extension User {
|
||||
// static var mocks: [Self] {
|
||||
// [
|
||||
// .init(email: "blob@test.com", username: "blob"),
|
||||
// .init(email: "blob-jr@test.com", username: "blob-jr"),
|
||||
// .init(email: "blob-sr@test.com", username: "blob-sr")
|
||||
// ]
|
||||
// }
|
||||
// }
|
||||
#if DEBUG
|
||||
public extension User.Create {
|
||||
static func generateMocks(count: Int = 5) -> [Self] {
|
||||
(0 ... count).reduce(into: [Self]()) { array, _ in
|
||||
array.append(.init(
|
||||
username: RandomNames.userNames.randomElement()! + String(RandomNames.characterString.randomElement()!),
|
||||
email: String(RandomNames.characterString.randomElement()!) + RandomNames.emails.randomElement()!,
|
||||
password: "super-secret",
|
||||
confirmPassword: "super-secret"
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user