Skip to content

Commit

Permalink
Fix dexie-syncable tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dfahlander committed Jul 6, 2023
1 parent b6e911b commit bf147d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions addons/Dexie.Syncable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"rollup -c tools/build-configs/rollup.config.js",
"rollup -c tools/build-configs/rollup.tests.config.js",
"node tools/replaceVersionAndDate.js dist/dexie-syncable.js",
"node tools/replaceVersionAndDate.js test/unit/bundle.js",
"# eslint ",
"eslint src --cache"
],
Expand Down
4 changes: 2 additions & 2 deletions addons/Dexie.Syncable/src/Dexie.Syncable.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function Syncable (db) {
if (!db.observable || (db.observable.version !== "{version}" && !/^(3|4)\./.test(db.observable.version)))
throw new Error(`Missing dexie-observable version 3.x or 4.x`);
if (db.syncable) {
if (db.syncable.version !== "{version}") throw new Error(`Mixed versions of dexie-syncable`);
if (db.syncable.version !== "{version}") throw new Error(`Mixed versions of dexie-syncable: "{version}" vs "${db.syncable.version}"`);
return; // Addon already active.
}

Expand Down Expand Up @@ -279,7 +279,7 @@ Syncable.registerSyncProtocol = function(name, protocolInstance) {

if (Dexie.Syncable) {
if (Dexie.Syncable.version !== "{version}") {
throw new Error (`Mixed versions of dexie-syncable`);
throw new Error (`Mixed versions of dexie-syncable: "{version}" vs "${Dexie.Syncable.version}"`);
}
} else {
// Register addon in Dexie:
Expand Down

0 comments on commit bf147d3

Please sign in to comment.