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'); });
it('beta.siteOrigin/robots.txt', function (done) { supertest(schsrch) .get('/robots.txt') .set('Host', 'beta.schsrch.xyz') .expect('Content-Type', /text\/plain/) .expect(200) .expect(res => res.text.should.have.length(0)) .end(done) })
it('should ignore empty urls', function(){ var text = 'div.image { background-image: url(""); } '; var urls = parseCssUrls(text); urls.should.be.instanceof(Array); urls.should.have.length(0); });
it('should be a method of the model', () => { should(data.users) .have.property('list') .which.is.Function() })
describe('#debug()', () => { it('should be a method of the model', () => { should(log) .have.property('debug') .which.is.Function() }) })
it('should handle urls without extension', function() { var text = '.image { background: url("image-without-ext"); } '; var urls = parseCssUrls(text); urls.should.be.instanceof(Array).and.have.lengthOf(1); urls.should.containEql('image-without-ext'); });
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() }) })
it('siteOrigin/robots.txt', function (done) { supertest(schsrch) .get('/robots.txt') .set('Host', 'schsrch.xyz') .expect('Content-Type', /text\/plain/) .expect(200) .expect(res => res.text.should.have.length(0)) .end(done) })
it('should exclude duplicated urls', function(){ var text = '\ @import url("a.css"); \ @import a.css; \ .image { background: url("a.css"); } \ '; var urls = parseCssUrls(text); urls.should.be.instanceof(Array).and.have.lengthOf(1); urls.should.containEql('a.css'); });