json-server 1.0.0-alpha.12 → 1.0.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/service.test.js +4 -3
- package/package.json +2 -1
package/lib/service.test.js
CHANGED
|
@@ -49,9 +49,10 @@ await test('constructor', () => {
|
|
|
49
49
|
const db = new Low(adapter, defaultData);
|
|
50
50
|
new Service(db);
|
|
51
51
|
if (Array.isArray(db.data['posts'])) {
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
assert.ok(
|
|
52
|
+
const id0 = db.data['posts']?.at(0)?.['id'];
|
|
53
|
+
const id1 = db.data['posts']?.at(1)?.['id'];
|
|
54
|
+
assert.ok(typeof id1 === 'string' && id1.length > 0, `id should be a non empty string but was: ${String(id1)}`);
|
|
55
|
+
assert.ok(typeof id0 === 'string' && id0 === '1', `id should not change if already set but was: ${String(id0)}`);
|
|
55
56
|
}
|
|
56
57
|
});
|
|
57
58
|
await test('findById', () => {
|