From 2230f6c1e4489c5c47814bea3fea9381d7d12061 Mon Sep 17 00:00:00 2001 From: mehdi Date: Tue, 19 Oct 2021 17:21:53 +0200 Subject: [PATCH] jsdoc details + timeout --- lib/datastore.js | 21 +++++++++++---------- test/persistence.test.js | 1 + 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/datastore.js b/lib/datastore.js index f301026..a28bf58 100755 --- a/lib/datastore.js +++ b/lib/datastore.js @@ -11,16 +11,17 @@ const { isDate } = require('./utils.js') class Datastore extends EventEmitter { /** * Create a new collection - * @param {String} options.filename Optional, datastore will be in-memory only if not provided - * @param {Boolean} options.timestampData Optional, defaults to false. If set to true, createdAt and updatedAt will be created and populated automatically (if not specified by user) - * @param {Boolean} options.inMemoryOnly Optional, defaults to false - * @param {String} options.nodeWebkitAppName Optional, specify the name of your NW app if you want options.filename to be relative to the directory where - * Node Webkit stores application data such as cookies and local storage (the best place to store data in my opinion) - * @param {Boolean} options.autoload Optional, defaults to false - * @param {Function} options.onload Optional, if autoload is used this will be called after the load database with the error object as parameter. If you don't pass it the error will be thrown - * @param {Function} options.afterSerialization/options.beforeDeserialization Optional, serialization hooks - * @param {Number} options.corruptAlertThreshold Optional, threshold after which an alert is thrown if too much data is corrupt - * @param {Function} options.compareStrings Optional, string comparison function that overrides default for sorting + * @param {String} [options.filename] Optional, datastore will be in-memory only if not provided + * @param {Boolean} [options.timestampData] Optional, defaults to false. If set to true, createdAt and updatedAt will be created and populated automatically (if not specified by user) + * @param {Boolean} [options.inMemoryOnly] Optional, defaults to false + * @param {String} [options.nodeWebkitAppName] Optional, specify the name of your NW app if you want options.filename to be relative to the directory where + * Node Webkit stores application data such as cookies and local storage (the best place to store data in my opinion) + * @param {Boolean} [options.autoload] Optional, defaults to false + * @param {Function} [options.onload] Optional, if autoload is used this will be called after the load database with the error object as parameter. If you don't pass it the error will be thrown + * @param {Function} [options.beforeDeserialization] Optional, serialization hooks + * @param {Function} [options.afterSerialization] Optional, serialization hooks + * @param {Number} [options.corruptAlertThreshold] Optional, threshold after which an alert is thrown if too much data is corrupt + * @param {Function} [options.compareStrings] Optional, string comparison function that overrides default for sorting * * Event Emitter - Events * * compaction.done - Fired whenever a compaction operation was finished diff --git a/test/persistence.test.js b/test/persistence.test.js index 5fa46e1..578707b 100755 --- a/test/persistence.test.js +++ b/test/persistence.test.js @@ -1037,6 +1037,7 @@ describe('Persistence', function () { // Not run on Windows as there is no clean way to set maximum file descriptors. Not an issue as the code itself is tested. it('Cannot cause EMFILE errors by opening too many file descriptors', function (done) { + this.timeout(5000) if (process.platform === 'win32' || process.platform === 'win64') { return done() } execFile('test_lac/openFdsLaunch.sh', function (err, stdout, stderr) { if (err) { return done(err) }