-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest.js
40 lines (37 loc) · 1.04 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
'use strict';
/*global describe, it */
require('should');
var cyc = require(__dirname + '/index');
describe('OpenCyc', function() {
it('should find concepts', function(done) {
cyc.find('batman', function(err, concepts) {
concepts.length.should.be.greaterThan(20);
concepts.should.containEql({
id: 'Mx4rvlbjDJwpEbGdrcN5Y29ycA',
name: 'Batman',
type: 'Individual'
}).and.containEql({
id: 'Mx4rwRRVd5wpEbGdrcN5Y29ycA',
name: 'Batman-MovieSeries',
type: 'Individual'
});
done();
});
});
it('should obtain concept', function(done) {
cyc.get('Mx4rwRRVd5wpEbGdrcN5Y29ycA', function(err, concept) {
concept.instances[0].label.should.equal('the Batman movie series');
concept.subtypes[0].label.should.equal('movie series product');
done();
});
});
it('should list instances of concept', function(done) {
cyc.get('Mx4rv9t9NFMnQdeStuhcY3fjLA', function(err, concept) {
concept.instances.should.containEql({
id: 'MX4RVPIM1PWPEBGDRCN5Y29YCA',
label: 'Royston Wood'
});
done();
});
});
});