Browser Client
// Constructor
var Server = function(cliOptions, done) {
EventEmitter.call(this)
setupLogger(cliOptions.logLevel, cliOptions.colors)
this.log = logger.create()
var config = cfg.parseConfig(cliOptions.configFile, cliOptions)
var modules = [{
…
socketServer: [‘factory’, createSocketIoServer]
…
}];
// Load the plugins
modules = modules.concat(plugin.resolve(config.plugins))
this._injector = new di.Injector(modules)
}
Server.start = function(cliOptions, done) {
var server = new Server(cliOptions, done);
server.start();
}
karma start
webServer.listen(config.port, function() {
self.log.info('Karma v%s server started at %s//%s:%s%s', constant.VERSION,
config.protocol, config.hostname, config.port, config.urlRoot)
if (config.browsers && config.browsers.length) {
console.log(launcher.launch, launcher);
self._injector.invoke(launcher.launch, launcher).forEach(function(browserLauncher) {
singleRunDoneBrowsers[browserLauncher.id] = false
})
}
})
log.info(‘Starting browser %s’, browser.name)
browser.start(url)
browsers.push(browser)
describe(‘Simple Testing’, function() {
it(‘should say the truth’, function(){
true.should.be.true;
});
it(‘should say lies’, function(){
true.should.be.false;
});
});
Simple example:
context.it = context.specify = function(title, fn) {
var suite = suites[0];
if (suite.pending) {
fn = null;
}
var test = new Test(title, fn);
test.file = file;
suite.addTest(test);
return test;
};
var SimpleReporter = function() {
this.onSpecComplete = function(browser, result) {
console.log(browser.name + (result.success ? ’OK’ : ’FAIL’);
};
this.onRunComplete = function() {
console.log(’All browsers are done.’);
}; };
Reporters:
Contribution Tactics
Look for:
Check for:
Follow the information flow through all the repo files
Try to:
Keep in mind:
Psych gem