From 8dd3914433c68370a04f3b6dc7cb2fa941e9acc7 Mon Sep 17 00:00:00 2001 From: Amogh Sahasrabhojanee Date: Sat, 8 May 2021 10:50:38 +0530 Subject: [PATCH] fix: path to db file in test --- app/spec/persistence/sqlite.spec.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/spec/persistence/sqlite.spec.js b/app/spec/persistence/sqlite.spec.js index 7b84466..996d451 100644 --- a/app/spec/persistence/sqlite.spec.js +++ b/app/spec/persistence/sqlite.spec.js @@ -1,5 +1,6 @@ const db = require('../../src/persistence/sqlite'); const fs = require('fs'); +const location = process.env.SQLITE_DB_LOCATION || '/etc/todos/todo.db'; const ITEM = { id: '7aef3d7c-d301-4846-8358-2a91ec9d6be3', @@ -8,8 +9,8 @@ const ITEM = { }; beforeEach(() => { - if (fs.existsSync('/etc/todos/todo.db')) { - fs.unlinkSync('/etc/todos/todo.db'); + if (fs.existsSync(location)) { + fs.unlinkSync(location); } });