We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3a7a8c commit 2711762Copy full SHA for 2711762
2 files changed
test/parallel/test-sqlite-aggregate-function.mjs
@@ -68,6 +68,19 @@ describe('DatabaseSync.prototype.aggregate()', () => {
68
message: /The "options\.directOnly" argument must be a boolean/,
69
});
70
71
+
72
+ test('throws if options.inverse is not a function', (t) => {
73
+ t.assert.throws(() => {
74
+ db.aggregate('sum', {
75
+ start: 0,
76
+ step: (acc, value) => acc + value,
77
+ inverse: 10
78
+ });
79
+ }, {
80
+ code: 'ERR_INVALID_ARG_TYPE',
81
+ message: /The "options\.inverse" argument must be a function/,
82
83
84
85
86
test/parallel/test-sqlite-template-tag.js
@@ -15,6 +15,17 @@ beforeEach(() => {
15
sql.clear();
16
17
18
+test('throws error if database is not open', () => {
19
+ const db = new DatabaseSync(':memory:', { open: false });
20
21
+ assert.throws(() => {
22
+ db.createTagStore(10);
23
24
+ code: 'ERR_INVALID_STATE',
25
+ message: 'database is not open'
26
27
+});
28
29
test('sql.run inserts data', () => {
30
assert.strictEqual(sql.run`INSERT INTO foo (text) VALUES (${'bob'})`.changes, 1);
31
assert.strictEqual(sql.run`INSERT INTO foo (text) VALUES (${'mac'})`.changes, 1);
0 commit comments