diff --git a/src/repository/realm-helper.ts b/src/repository/realm-helper.ts index a42b5c6..c534ab0 100644 --- a/src/repository/realm-helper.ts +++ b/src/repository/realm-helper.ts @@ -35,8 +35,13 @@ export default class RealmHelper { } public static init(mode: string): void { + let users: User[]; + if (mode === "development") { this._config.path = "database/test/users"; + users = require("../../spec/support/test-users").default; + } else { + users = require("../assets/seed.json").users; } const realm = this.defaultRealm; @@ -45,8 +50,6 @@ export default class RealmHelper { return; } - const users: User[] = require("../assets/seed.json").users; - realm.write(() => { for (const user of users) { realm.create(UserSchema.name, user);