Skip to content

Commit

Permalink
test for levelgraph#197
Browse files Browse the repository at this point in the history
  • Loading branch information
scenaristeur committed Jun 23, 2023
1 parent 9b68b4d commit d1e221a
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -17,5 +17,6 @@ npm-debug.log
docs
.DS_Store
coverage
db_test

package-lock.json
15 changes: 15 additions & 0 deletions CHANGELOG.md
@@ -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
```
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -58,7 +58,7 @@
"dependencies": {
"callback-stream": "^1.1.0",
"inherits": "^2.0.4",
"level-ws": "^3.0.0",
"level-ws": "^4.0.0",
"lodash.keys": "^4.2.0",
"pump": "^3.0.0",
"readable-stream": "^4.0.0",
Expand Down
33 changes: 33 additions & 0 deletions test/persist_properties_spec copy.js
@@ -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();
});
});
});
});

0 comments on commit d1e221a

Please sign in to comment.