GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — sqlite: add some tests · nodejs/node@6442229

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-sqlite-aggregate-function.mjs
    • test-sqlite-template-tag.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-sqlite-aggregate-function.mjs‎

Copy file name to clipboardExpand all lines: test/parallel/test-sqlite-aggregate-function.mjs
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,19 @@ describe('DatabaseSync.prototype.aggregate()', () => {
6868
message: /The "options\.directOnly" argument must be a boolean/,
6969
});
7070
});
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+
});
7184
});
7285
});
7386

Collapse file

‎test/parallel/test-sqlite-template-tag.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-sqlite-template-tag.js
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ beforeEach(() => {
1515
sql.clear();
1616
});
1717

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+
1829
test('sql.run inserts data', () => {
1930
assert.strictEqual(sql.run`INSERT INTO foo (text) VALUES (${'bob'})`.changes, 1);
2031
assert.strictEqual(sql.run`INSERT INTO foo (text) VALUES (${'mac'})`.changes, 1);

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.