Skip to content

Commit 91cccc7

Browse files
committed
add intial test for version api
1 parent 38c4a07 commit 91cccc7

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

lib/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
const addon = require('../native/index.node');
2-
3-
console.log(addon.version());
1+
module.exports = require('../native/index.node')

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"scripts": {
1212
"build": "neon build",
1313
"install": "yarn build",
14-
"lint": "eslint lib test"
14+
"lint": "eslint lib test",
15+
"test": "jest ."
1516
},
1617
"devDependencies": {
1718
"eslint": "^5.9.0",

test/__snapshots__/basic.spec.js.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`basic should get sqlite version 1`] = `"3.24.0"`;

test/basic.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
const Sqlite = require('..');
2+
13
describe('basic', () => {
24
it('should get sqlite version', () => {
3-
5+
expect(Sqlite.version()).toMatchSnapshot();
46
})
57
})

0 commit comments

Comments
 (0)