Browse Source

Mock realm DB object

pull/1/head
Tim Glasgow 2 years ago
parent
commit
652ade7179
  1. 21
      squarenotsquare/__mock__/mockRealmObject.js

21
squarenotsquare/__mock__/mockRealmObject.js

@ -0,0 +1,21 @@
import { Score } from "../realm/entities/Score";
import { System } from "../realm/entities/System";
import { User } from "../realm/entities/User";
export class MockRealm{
constructor(schemaVersion){
this.schemaVersion = schemaVersion;
this.SystemRepo = System.name;
this.ScoreRepo = Score.name;
this.UserRepo = User.name;
this[this.SystemRepo] = [];
this[this.ScoreRepo] = [];
this[this.UserRepo] = [];
}
create(repoName, entity){
this[repoName].push(entity);
}
}
Loading…
Cancel
Save