Skip to content

Instantly share code, notes, and snippets.

@DrewML
Last active February 29, 2016 22:09
Show Gist options
  • Save DrewML/ad11884e0d84a90c4167 to your computer and use it in GitHub Desktop.
Save DrewML/ad11884e0d84a90c4167 to your computer and use it in GitHub Desktop.
// Note: ES6 syntax requires a version of Node.js >= 4.0.0
'use strict';
// Can use any lib (or none, if you choose) to parse args.
// "npm install yargs --save" to use this example as-is
let argv = require('yargs').argv;
const DELIMITER = ',';
const TAG_IDENT = '#';
let tagsOpt = typeof argv.tags === 'string' && argv.tags;
let grepString, tags;
if (tagsOpt) {
tags = tagsOpt.split(DELIMITER);
grepString = tags.map(tag => `${TAG_IDENT}${tag}`).join('|');
}
module.exports = function getMochaTags() {
return grepString;
};
// Note: ES6 syntax requires a version of Node.js >= 4.0.0
'use strict';
let tags = require('./protractor-mocha-tags')();
exports.config = {
framework: 'mocha',
capabilities: { browserName: 'chrome' },
specs: ['tests/**/*.spec.js'],
mochaOpts: {
reporter: 'spec',
grep: tags
}
};
// Note: ES6 syntax requires a version of Node.js >= 4.0.0
'use strict';
describe('Some Feature/Page #feature1', function() {
it('should do some thing #slow', () => {
// assertions
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment