forked from levelgraph/levelgraph
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b68b4d
commit d1e221a
Showing
4 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,5 +17,6 @@ npm-debug.log | |
docs | ||
.DS_Store | ||
coverage | ||
db_test | ||
|
||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# level has been upgraded | ||
- https://github.com/levelgraph/levelgraph-jsonld/pull/77 | ||
|
||
``` | ||
npm outdated | ||
Package Current Wanted Latest Location Depended by | ||
callback-stream MISSING 1.1.0 1.1.0 - levelgraph | ||
inherits MISSING 2.0.4 2.0.4 - levelgraph | ||
level-ws MISSING 3.0.0 4.0.0 - levelgraph | ||
lodash.keys MISSING 4.2.0 4.2.0 - levelgraph | ||
pump MISSING 3.0.0 3.0.0 - levelgraph | ||
readable-stream MISSING 4.4.0 4.4.0 - levelgraph | ||
steed MISSING 1.1.3 1.1.3 - levelgraph | ||
xtend MISSING 4.0.2 4.0.2 - levelgraph | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
var levelgraph = require('../lib/levelgraph') | ||
// according to https://github.com/Level/level/blob/master/UPGRADING.md | ||
const { Level } = require('level') | ||
|
||
describe('a basic triple store', function() { | ||
|
||
var db; | ||
|
||
beforeEach(function() { | ||
var level = require('level'), | ||
yourDB = new Level('./db_test', { valueEncoding: 'json' }) | ||
db = levelgraph(yourDB); | ||
}); | ||
|
||
afterEach(function(done) { | ||
db.close(done); | ||
}); | ||
|
||
it('persist, should put some more data inside a triple', function(done) { | ||
var triple = { subject: 'a', predicate: 'b', object: 'c', 'someStuff': 42 }; | ||
db.put(triple, done); | ||
}); | ||
|
||
it('persist, should return the inserted data', function(done) { | ||
var triple = { subject: 'a', predicate: 'b', object: 'c', 'someStuff': 42 }; | ||
db.put(triple, function() { | ||
db.get({ subject: 'a' }, function(err, list) { | ||
expect(list).to.eql([triple]); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); |