Skip to content

Commit 0d1a85c

Browse files
committed
add tests
1 parent 6c7022c commit 0d1a85c

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

test/module/db-spec.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
describe('a db module', function () {
22

33
var db = require('../../src/db.js');
4+
var runtime = require('../../src/runtime.js');
5+
6+
runtime.system('test');
47

58
it('can find all document of a collection', function () {
69
var result = db._Runtime.find();
@@ -86,11 +89,9 @@ describe('a db module', function () {
8689
var result = null;
8790

8891
result = db.exportSystem();
89-
9092
expect(result).toBeDefined();
9193
});
9294

93-
9495
it('can apply a filter on the export', function () {
9596
var result = null;
9697

@@ -99,6 +100,25 @@ describe('a db module', function () {
99100
expect(result).toBeDefined();
100101
});
101102

103+
it('can import a system', function () {
104+
var result = null;
105+
106+
result = db.importSystem({
107+
"_id": "u195cc1c1dd16c47",
108+
"name": "test2",
109+
"description": "",
110+
"version": "0.0.1",
111+
"master": true,
112+
"schemas": {},
113+
"models": {},
114+
"types": {},
115+
"behaviors": {},
116+
"components": {}
117+
});
118+
119+
expect(result).not.toBe('');
120+
});
121+
102122
it('can init the database', function () {
103123
var result = null;
104124

0 commit comments

Comments
 (0)