Skip to content

Instantly share code, notes, and snippets.

@lightsofapollo
Created July 19, 2013 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lightsofapollo/6042786 to your computer and use it in GitHub Desktop.
Save lightsofapollo/6042786 to your computer and use it in GitHub Desktop.
// the child process needs to be sent some metadata to start.
// see: https://gist.github.com/lightsofapollo/6042626#file-host-api-js-L7
// this is the metadata
var metadata = {
host: 'firefox'
};
// runs
marionette('some test', { host: ['firefox', 'b2g-desktop'] }, function() {
});
// does not run
marionette('some test', { host: ['device'] }, function() {
});
// runs
marionette('some test', { host: 'firefox' }, function() {
});
// runs
marionette('everything', function() {
});
/**
the final argument of the test will be put into a "suite"
for example the final example would be converted to:
suite('everything', function() {
});
*/
@ganesh7
Copy link

ganesh7 commented Jul 19, 2013

// Is this correct?

// this is the metadata
var metadata = {
host: ['firefox', 'device']
};

// runs
marionette('some test', { host: ['firefox', 'b2g-desktop'] }, function() {
});

// runs
marionette('some test', { host: ['device'] }, function() {
});

// runs
marionette('some test', { host: 'firefox' }, function() {
});

// runs
marionette('everything', function() {
});

/**
the final argument of the test will be put into a "suite"
for example the final example would be converted to:

suite('everything', function() {
});

*/

@ganesh7
Copy link

ganesh7 commented Jul 21, 2013

// in child process ///

var fs = require('fs');

// we need a file name
var filename = '';
var filepathname = __dirname+ filename;

var contents = fs.readFileSync(filepathname).toString();

var data = JSON.parse(contents);

var host = data.host;

// here we run tests depending on the host
runTests(host);

// I'm confused what to do at this point after the tests have been run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment