diff --git a/CHANGELOG.md b/CHANGELOG.md index 099eb639..22a3639a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,10 @@ Many thanks to the following for contributing to this release: ## Version 2.0.0-alpha.19 +### Features + +- Added Datastore and Datastore Provider classes to the library to support savable Maps [#629](https://github.com/clusterio/clusterio/pull/629). + ### Changes - Fixed IPC errors reporting undefined when no stack trace was present [#624](https://github.com/clusterio/clusterio/pull/624). diff --git a/test/lib/datastore.js b/test/lib/datastore.js index 4c14c678..0a690163 100644 --- a/test/lib/datastore.js +++ b/test/lib/datastore.js @@ -539,6 +539,9 @@ describe("lib/datastore", function() { datastore.set(value); assert.notEqual(value.updatedAtMs, undefined); assert(value.updatedAtMs > 0, "updatedAtMs greater than zero"); + const prev = value.updatedAtMs; + datastore.set(value); + assert(value.updatedAtMs > prev, "updatedAtMs must increase"); }); }); @@ -568,6 +571,10 @@ describe("lib/datastore", function() { assert.notEqual(updates[1].updatedAtMs, undefined); assert(updates[0].updatedAtMs > 0, "updatedAtMs greater than zero"); assert(updates[1].updatedAtMs > 0, "updatedAtMs greater than zero"); + const prev = [updates[0].updatedAtMs, updates[1].updatedAtMs]; + datastore.setMany(updates); + assert(updates[0].updatedAtMs > prev[0], "updatedAtMs must increase"); + assert(updates[1].updatedAtMs > prev[1], "updatedAtMs must increase"); }); });