Mon voyage into the Open Source sea

  • Karma is an example of a test runner
  • Mocha is an example of a testing framework
  • Chai is an example of an assertion library
  • Sinon is an example of a testing plugin

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

  • Something slightly new that you are very passionate about.
  •  Repositories that handles a familiar language
  • Frameworks or libraries that you have used before

Look for:

  • Issues section on the project repository

Check for:

  • Pull request made by others 
  • Life signals inside the repository
  • Follow the information flow through all the repo files

  • Identify parts that are hard to grasp and try to think on how to refactor
  • Identify “important people” in the project you choose

Try to:

Keep in mind:

  • Some repositories have different guidelines to contribute.
  • Rebase your project in order to keep up with the changes other people do.
  • Notify people you will start working on X issue or you are reviewing Y.

Psych gem

Questions?

Thank you!

Mon voyage into the Open Source sea

By Carlos Contreiras

Mon voyage into the Open Source sea

  • 390