@applitools/eyes-cypress 3.28.0 → 3.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,23 +1,23 @@
1
- 'use strict';
1
+ 'use strict'
2
2
 
3
- const fs = require('fs');
4
- const chalk = require('chalk');
5
- const addEyesCommands = require('./addEyesCommands');
6
- const isCommandsDefined = require('./isCommandsDefined');
3
+ const fs = require('fs')
4
+ const chalk = require('chalk')
5
+ const addEyesCommands = require('./addEyesCommands')
6
+ const isCommandsDefined = require('./isCommandsDefined')
7
7
 
8
8
  function handleCommands(supportFilePath) {
9
9
  if (supportFilePath) {
10
- const supportFileContent = fs.readFileSync(supportFilePath, 'utf-8');
10
+ const supportFileContent = fs.readFileSync(supportFilePath, 'utf-8')
11
11
 
12
12
  if (!isCommandsDefined(supportFileContent)) {
13
- fs.writeFileSync(supportFilePath, addEyesCommands(supportFileContent));
14
- console.log(chalk.cyan('Commands defined.'));
13
+ fs.writeFileSync(supportFilePath, addEyesCommands(supportFileContent))
14
+ console.log(chalk.cyan('Commands defined.'))
15
15
  } else {
16
- console.log(chalk.cyan('Commands already defined.'));
16
+ console.log(chalk.cyan('Commands already defined.'))
17
17
  }
18
18
  } else {
19
- throw new Error('Commands could not be defined. Support file could not be found');
19
+ throw new Error('Commands could not be defined. Support file could not be found')
20
20
  }
21
21
  }
22
22
 
23
- module.exports = handleCommands;
23
+ module.exports = handleCommands
@@ -1,19 +1,19 @@
1
- 'use strict';
1
+ 'use strict'
2
2
 
3
- const chalk = require('chalk');
4
- const {addEyesCypressPlugin} = require('./addEyesCypressPlugin');
5
- const isPluginDefined = require('./isPluginDefined');
6
- const fs = require('fs');
3
+ const chalk = require('chalk')
4
+ const {addEyesCypressPlugin} = require('./addEyesCypressPlugin')
5
+ const isPluginDefined = require('./isPluginDefined')
6
+ const fs = require('fs')
7
7
 
8
8
  function handlePlugin(pluginsFilePath) {
9
- const fileContent = fs.readFileSync(pluginsFilePath, 'utf-8');
9
+ const fileContent = fs.readFileSync(pluginsFilePath, 'utf-8')
10
10
 
11
11
  if (!isPluginDefined(fileContent)) {
12
- fs.writeFileSync(pluginsFilePath, addEyesCypressPlugin(fileContent));
13
- console.log(chalk.cyan('Plugins defined.'));
12
+ fs.writeFileSync(pluginsFilePath, addEyesCypressPlugin(fileContent))
13
+ console.log(chalk.cyan('Plugins defined.'))
14
14
  } else {
15
- console.log(chalk.cyan('Plugins already defined'));
15
+ console.log(chalk.cyan('Plugins already defined'))
16
16
  }
17
17
  }
18
18
 
19
- module.exports = handlePlugin;
19
+ module.exports = handlePlugin
@@ -1,15 +1,15 @@
1
- 'use strict';
2
- const chalk = require('chalk');
3
- const {writeFileSync, existsSync} = require('fs');
4
- const eyesIndexContent = `import "@applitools/eyes-cypress"`;
1
+ 'use strict'
2
+ const chalk = require('chalk')
3
+ const {writeFileSync, existsSync} = require('fs')
4
+ const eyesIndexContent = `import "@applitools/eyes-cypress"`
5
5
 
6
6
  function handleTypeScript(typeScriptFilePath) {
7
7
  if (!existsSync(typeScriptFilePath)) {
8
- writeFileSync(typeScriptFilePath, eyesIndexContent);
9
- console.log(chalk.cyan('TypeScript defined.'));
8
+ writeFileSync(typeScriptFilePath, eyesIndexContent)
9
+ console.log(chalk.cyan('TypeScript defined.'))
10
10
  } else {
11
- console.log(chalk.cyan('TypeScript already defined.'));
11
+ console.log(chalk.cyan('TypeScript already defined.'))
12
12
  }
13
13
  }
14
14
 
15
- module.exports = {handleTypeScript, eyesIndexContent};
15
+ module.exports = {handleTypeScript, eyesIndexContent}
@@ -1,7 +1,7 @@
1
- 'use strict';
1
+ 'use strict'
2
2
 
3
3
  function isCommandsDefined(content) {
4
- return !!content.match(/['"]@applitools\/eyes-cypress\/commands['"]\s*/);
4
+ return !!content.match(/['"]@applitools\/eyes-cypress\/commands['"]\s*/)
5
5
  }
6
6
 
7
- module.exports = isCommandsDefined;
7
+ module.exports = isCommandsDefined
@@ -1,7 +1,7 @@
1
- 'use strict';
1
+ 'use strict'
2
2
 
3
3
  function isPluginDefined(content) {
4
- return !!content.match(/require\s*\(\s*['"]@applitools\/eyes-cypress['"]\s*\)/);
4
+ return !!content.match(/require\s*\(\s*['"]@applitools\/eyes-cypress['"]\s*\)/)
5
5
  }
6
6
 
7
- module.exports = isPluginDefined;
7
+ module.exports = isPluginDefined