it('should load all modules under the path but sub-directory', function() { var services = Loader.load(path); should.exist(services); services.should.have.property('addOneRemote'); services.addOneRemote.should.be.a('object'); services.addOneRemote.should.have.property('doService'); services.addOneRemote.doService.should.be.a('function'); services.addOneRemote.should.have.property('doAddTwo'); services.addOneRemote.doService.should.be.a('function'); services.should.have.property('addThreeRemote'); services.addThreeRemote.should.be.a('object'); services.addThreeRemote.should.have.property('doService'); services.addThreeRemote.doService.should.be.a('function'); // should use the name as module name if the module has a name property services.should.have.property('whoAmIRemote'); services.whoAmIRemote.should.be.a('object'); services.whoAmIRemote.should.have.property('doService'); services.whoAmIRemote.doService.should.be.a('function'); services.whoAmIRemote.should.have.property('name'); services.whoAmIRemote.name.should.be.a('string'); });
describe('PMX driver', function() { it('should have the right properties', function(done) { pmx.should.have.property('emit'); pmx.should.have.property('action'); done(); }); describe('Event module', function() { it('should not hang if process not forked', function(done) { pmx.emit('testo', { data : 'ok' }); done(); }); }); });
it('should be a method of the model', () => { should(data.users) .have.property('list') .which.is.Function() })
describe('crypto.encryptPrivateKey', () => { it('should return an encrypted private key', async () => { const crypto = Crypto({ cryptoLib: webcrypto, }); const keys = await crypto.generateKeyPair(); const encrypted = await crypto.encryptPrivateKey('mypassword', keys.rsaKeys.privateKey); encrypted.should.have.property('wrappedKey'); encrypted.should.have.property('iv'); encrypted.should.have.property('salt'); }); });
describe('#debug()', () => { it('should be a method of the model', () => { should(log) .have.property('debug') .which.is.Function() }) })
it('has #_query property', () => { should(data.tag) .have.property('query') .which.is.Object() })
it('should load all modules under the path but sub-directory', function() { var services = Loader.load(path); should.exist(services); services.should.have.property('addOneRemote'); services.addOneRemote.should.be.a('object'); services.addOneRemote.should.have.property('doService'); services.addOneRemote.doService.should.be.a('function'); services.addOneRemote.should.have.property('doAddTwo'); services.addOneRemote.doService.should.be.a('function'); services.should.have.property('addThreeRemote'); services.addThreeRemote.should.be.a('object'); services.addThreeRemote.should.have.property('doService'); services.addThreeRemote.doService.should.be.a('function'); // should use the name as module name if the module has a name property services.should.have.property('whoAmIRemote'); services.whoAmIRemote.should.be.a('object'); services.whoAmIRemote.should.have.property('doService'); services.whoAmIRemote.doService.should.be.a('function'); services.whoAmIRemote.should.have.property('name'); services.whoAmIRemote.name.should.be.a('string'); });
describe('#error()', () => { it('should be a method of the model', () => { should(log) .have.property('error') .which.is.Function() }) })
describe('#warn()', () => { it('should be a method of the model', () => { should(log) .have.property('warn') .which.is.Function() }) })
describe('crypto.encryptPrivateKey', () => { it('should return an encrypted private key', async () => { const crypto = Crypto({ cryptoLib: webcrypto, }); const keys = await crypto.generateKeyPair(); const encrypted = await crypto.encryptPrivateKey('mypassword', keys.rsaKeys.privateKey); encrypted.should.have.property('wrappedKey'); encrypted.should.have.property('iv'); encrypted.should.have.property('salt'); }); });
describe('#info()', () => { it('should be a method of the model', () => { should(log) .have.property('info') .which.is.Function() }) })