forked from inventures/hatchjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhatch.test.js
41 lines (33 loc) · 1.12 KB
/
hatch.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
var should = require('./');
var app, hatch;
var should = require('should');
describe('Hatch', function() {
before(function(done) {
app = getApp(done);
hatch = app.compound.hatch;
});
it('should load module', function(done) {
hatch.loadModules(__dirname + '/fixtures/modules');
var mod = hatch.modules.simple;
should.exist(mod);
mod.compound.on('ready', function() {
done();
});
mod.info.name.should.equal('simple');
});
it('should load widgets', function(done) {
hatch.loadModule('widgets', __dirname + '/fixtures/widgets');
done();
});
it('should load pages', function(done) {
hatch.loadModule('pages', __dirname + '/fixtures/pages');
done();
});
it('should register core model', function() {
var CoreModel = {modelName: 'CoreModel'};
hatch.registerCoreModel(CoreModel);
should.exist(hatch.modules.simple.compound.models.CoreModel);
should.exist(hatch.modules.widgets.compound.models.CoreModel);
should.exist(hatch.compound.models.CoreModel);
});
});