From 652ade7179e33d910fd5bb9ec41643fee5841b85 Mon Sep 17 00:00:00 2001 From: Tim Glasgow Date: Wed, 27 Jul 2022 22:12:43 -0500 Subject: [PATCH] Mock realm DB object --- squarenotsquare/__mock__/mockRealmObject.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 squarenotsquare/__mock__/mockRealmObject.js diff --git a/squarenotsquare/__mock__/mockRealmObject.js b/squarenotsquare/__mock__/mockRealmObject.js new file mode 100644 index 0000000..22c409b --- /dev/null +++ b/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); + } +} \ No newline at end of file