Commit d6904f91 authored by Aral Balkan's avatar Aral Balkan
Browse files

Code coverage back at 100%

parent f9a3db2e
......@@ -44,8 +44,7 @@ export default class JSTable extends EventEmitter {
// Either loads the table at the passed table path (default) or, if
// data is passed, creates a new table at table path, populating
// it with the passed data.
constructor(tablePath, data = null, options = { compactOnLoad:true, alwaysUseLineByLineLoads: false }
) {
constructor(tablePath, data = null, options = { compactOnLoad:true, alwaysUseLineByLineLoads: false }) {
super()
this.tablePath = tablePath
......@@ -78,6 +77,8 @@ export default class JSTable extends EventEmitter {
// NB. we are returning the data proxy, not an
// instance of JSTable. Use accordingly.
// Note: coverage ignore is due to this bug in c8: https://github.com/bcoe/c8/issues/290
/* c8 ignore next 2 */
return this.#dataProxy
}
......
......@@ -303,12 +303,12 @@ export default class QuerySanitiser {
result = data.filter(function(value) {
try {
return query(value)
} catch (error) /* istanbul ignore next */ {
} catch (error) /* c8 ignore start */ {
// Unexpected error: something went wrong while executing the query.
// (This should not happen as all errors should have been caught before this point.)
log(' 💾 ❨JSDB❩ Warning: query function threw unexpected error; rejecting.', queryString, error)
return false
}
} /* c8 ignore stop */
})
}
......
......@@ -34,6 +34,6 @@ export function log (...args) {
if (process.env.QUIET) {
return
}
// istanbul ignore next
/* c8 ignore next */
console.log(...args)
}
......@@ -153,7 +153,7 @@ test('basic persistence', t => {
t.strictEquals(dehydrate(actualTableSourceBeforeCompaction), dehydrate(expectedTableSourceBeforeCompaction), 'table source is as expected before compaction')
//
// Table loading (require).
// Table loading (all at once).
//
const inMemoryStateOfPeopleTableFromOriginalDatabase = JSON.stringify(db.people)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment