summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/bg/js/database.js6
-rw-r--r--test/test-database.js2
2 files changed, 8 insertions, 0 deletions
diff --git a/ext/bg/js/database.js b/ext/bg/js/database.js
index b54d832c..02d59c83 100644
--- a/ext/bg/js/database.js
+++ b/ext/bg/js/database.js
@@ -96,6 +96,12 @@ class Database {
}
}
+ async close() {
+ this.validate();
+ this.db.close();
+ this.db = null;
+ }
+
async purge() {
this.validate();
diff --git a/test/test-database.js b/test/test-database.js
index d66e2137..cefa297c 100644
--- a/test/test-database.js
+++ b/test/test-database.js
@@ -130,6 +130,8 @@ async function testDatabase1() {
// Cleanup
await cleanup();
}
+
+ await database.close();
}
async function testDatabaseEmpty1(database) {