Skip to content

Instantly share code, notes, and snippets.

@dualyticalchemy
Created February 7, 2021 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dualyticalchemy/21139da78980f4d68ed7a595972e54ab to your computer and use it in GitHub Desktop.
Save dualyticalchemy/21139da78980f4d68ed7a595972e54ab to your computer and use it in GitHub Desktop.
const chalk = require('chalk');
module.exports = (chromeOptionsConfig, active) => {
const msg = [
`Are you testing for phone or tablet? Check`,
chalk.white('/tests/conf/platform.conf.json'),
`for the default`].join(' ');
const notifications = [
{
"rel": "help",
"command": chalk.blue(msg)
}
];
const help = notification => notification.rel === 'help';
console.log(notifications.filter(help).pop().command);
const has = (name) => chromeOptionsConfig
&& chromeOptionsConfig[active || 'default']
&& chromeOptionsConfig[active || 'default']
.mobileEmulation
.device
.includes(name);
return {
has
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment