From 61ae14f6c260cc9ebfc5e6052de91fa8f6022e8f Mon Sep 17 00:00:00 2001 From: Vladimir Voronkov Date: Fri, 5 May 2023 14:31:14 +0300 Subject: [PATCH 1/2] Bump better-sqlite3 version up to 8.3.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6536cd4..a256c21 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ }, "dependencies": { "async": "3.2.4", - "better-sqlite3": "7.6.2", + "better-sqlite3": "8.3.0", "bfx-facs-base": "git+https://github.com/bitfinexcom/bfx-facs-base.git" }, "engine": { From 58d36b8220a580a28d84d8f0fa35fe1b4fc4601c Mon Sep 17 00:00:00 2001 From: Vladimir Voronkov Date: Mon, 8 May 2023 13:23:40 +0300 Subject: [PATCH 2/2] Resolve deprecation warning fs.rmdir due to migration nodejs to v16 --- test/base-worker.spec.js | 12 ++++++------ test/extended-worker.spec.js | 8 ++++---- test/helpers/index.js | 4 +++- test/helpers/utils.js | 12 ++++++++++++ test/load-extended-worker.spec.js | 8 ++++---- test/sync-queries.spec.js | 8 ++++---- 6 files changed, 33 insertions(+), 19 deletions(-) create mode 100644 test/helpers/utils.js diff --git a/test/base-worker.spec.js b/test/base-worker.spec.js index eaccdc5..6ba9807 100644 --- a/test/base-worker.spec.js +++ b/test/base-worker.spec.js @@ -5,13 +5,13 @@ chai.use(require('chai-fs')) const { assert } = chai const path = require('path') const { - rmdirSync, mkdirSync } = require('fs') const { getTableCreationQuery, - getTableDeletionQuery + getTableDeletionQuery, + rmRfSync } = require('./helpers') const DB_WORKER_ACTIONS = require( @@ -39,17 +39,17 @@ const tableData = [ describe('Base worker', () => { before(() => { - rmdirSync(dbPathAbsolute, { recursive: true }) + rmRfSync(dbPathAbsolute) mkdirSync(dbPathAbsolute, { recursive: true }) }) after(() => { - rmdirSync(dbPathAbsolute, { recursive: true }) + rmRfSync(dbPathAbsolute) }) describe('Setup step', () => { beforeEach(() => { - rmdirSync(dbPathAbsolute, { recursive: true }) + rmRfSync(dbPathAbsolute) mkdirSync(dbPathAbsolute, { recursive: true }) }) @@ -134,7 +134,7 @@ describe('Base worker', () => { let fac before((done) => { - rmdirSync(dbPathAbsolute, { recursive: true }) + rmRfSync(dbPathAbsolute) mkdirSync(dbPathAbsolute, { recursive: true }) fac = new Fac(caller, { dbPathAbsolute }) diff --git a/test/extended-worker.spec.js b/test/extended-worker.spec.js index 14d4a29..115613f 100644 --- a/test/extended-worker.spec.js +++ b/test/extended-worker.spec.js @@ -3,13 +3,13 @@ const { assert } = require('chai') const path = require('path') const { - rmdirSync, mkdirSync } = require('fs') const { getTableCreationQuery, - getTableDeletionQuery + getTableDeletionQuery, + rmRfSync } = require('./helpers') const BASE_DB_WORKER_ACTIONS = require( @@ -42,12 +42,12 @@ const tableData = [ describe('Extended worker', () => { before(() => { - rmdirSync(dbPathAbsolute, { recursive: true }) + rmRfSync(dbPathAbsolute) mkdirSync(dbPathAbsolute, { recursive: true }) }) after(() => { - rmdirSync(dbPathAbsolute, { recursive: true }) + rmRfSync(dbPathAbsolute) }) it('Setup step', (done) => { diff --git a/test/helpers/index.js b/test/helpers/index.js index b77c6d9..7fb1d1b 100644 --- a/test/helpers/index.js +++ b/test/helpers/index.js @@ -2,8 +2,10 @@ const getTableCreationQuery = require('./get-table-creation-query') const getTableDeletionQuery = require('./get-table-deletion-query') +const { rmRfSync } = require('./utils') module.exports = { getTableCreationQuery, - getTableDeletionQuery + getTableDeletionQuery, + rmRfSync } diff --git a/test/helpers/utils.js b/test/helpers/utils.js new file mode 100644 index 0000000..9eb405c --- /dev/null +++ b/test/helpers/utils.js @@ -0,0 +1,12 @@ +'use strict' + +const fs = require('fs') + +const rmRfSync = (path) => fs.rmSync(path, { + recursive: true, + force: true +}) + +module.exports = { + rmRfSync +} diff --git a/test/load-extended-worker.spec.js b/test/load-extended-worker.spec.js index 3a7e590..3add62a 100644 --- a/test/load-extended-worker.spec.js +++ b/test/load-extended-worker.spec.js @@ -3,14 +3,14 @@ const { assert } = require('chai') const path = require('path') const { - rmdirSync, mkdirSync } = require('fs') const { promisify } = require('util') const { getTableCreationQuery, - getTableDeletionQuery + getTableDeletionQuery, + rmRfSync } = require('./helpers') const BASE_DB_WORKER_ACTIONS = require( @@ -38,7 +38,7 @@ describe('Load extended worker', () => { let fac before(async () => { - rmdirSync(dbPathAbsolute, { recursive: true }) + rmRfSync(dbPathAbsolute) mkdirSync(dbPathAbsolute, { recursive: true }) fac = new Fac( @@ -55,7 +55,7 @@ describe('Load extended worker', () => { after((done) => { fac.stop(() => { - rmdirSync(dbPathAbsolute, { recursive: true }) + rmRfSync(dbPathAbsolute) done() }) }) diff --git a/test/sync-queries.spec.js b/test/sync-queries.spec.js index 7995ad6..037e214 100644 --- a/test/sync-queries.spec.js +++ b/test/sync-queries.spec.js @@ -3,13 +3,13 @@ const { assert } = require('chai') const path = require('path') const { - rmdirSync, mkdirSync } = require('fs') const { getTableCreationQuery, - getTableDeletionQuery + getTableDeletionQuery, + rmRfSync } = require('./helpers') const DB_WORKER_ACTIONS = require( @@ -37,12 +37,12 @@ const tableData = [ describe('Sync queries', () => { before(() => { - rmdirSync(dbPathAbsolute, { recursive: true }) + rmRfSync(dbPathAbsolute) mkdirSync(dbPathAbsolute, { recursive: true }) }) after(() => { - rmdirSync(dbPathAbsolute, { recursive: true }) + rmRfSync(dbPathAbsolute) }) it('Setup step', (done) => {