Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

appium-gulp-plugins

Package Overview
Dependencies
Maintainers
1
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appium-gulp-plugins

Custom gulp plugins to be used accross all appium modules

  • 0.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.5K
increased by105.31%
Maintainers
1
Weekly downloads
 
Created
Source

appium-gulp-plugins

Custom plugins used accross appium modules

transpile plugin

Traceur compilation, sourcemaps and file renaming functionality in one plugin. .es7.js and .es6.js files will be automatically renamed to .js files. The necessary sourcemaps and traceur comments and imports are also automatically added.

usage

1/ Configure gulp as below:

var gulp = require('gulp'),
Transpiler = require('appium-gulp-plugins').Transpiler;

gulp.task('transpile', function () {
  var transpiler = new Transpiler();
  // traceur options are configurable in transpiler.traceurOpts

  return gulp.src('test/fixtures/es7/**/*.js')
    .pipe(transpiler.stream())
    .pipe(gulp.dest('build'));
});

2/ in your code you need to mark the main and mocha files as below:

  • main: add // transpile:main at the beginning of the file (example here) .
  • mocha: add // transpile:mocha at the beginning of the file (example here)

Regular lib files do not need any extra comments.

with gulp-mocha

Set the following env variable to skip the traceur runtime declaration.

process.env.SKIP_TRACEUR_RUNTIME = true;

watch plugin

There are some issues Gulp 3.x error handling which cause the default gulp-watch to hang. This pluging is a small hack which solves that by respawning the whole process on error. This should not be needed is gulp 4.0.

usage

var gulp = require('gulp'),
    spawnWatcher = require('./index').spawnWatcher.use(gulp);

spawnWatcher.configure('watch', ['lib/**/*.js','test/**/*.js','!test/fixtures'], function() {
  // this is the watch action
  return runSequence('test');
});

error handling

The spawn needs to catch error as soon as they happen. To do so use the spawnWatcher.handleError method, for instance:

// add error handling where needed
gulp.task('transpile', function () {
  return gulp.src('test/es7/**/*.js')
    .pipe(transpile())
    .on('error', spawnWatcher.handleError)
    .pipe(gulp.dest('build'));
});

gulp.task('test', ['transpile'] , function () {
  process.env.SKIP_TRACEUR_RUNTIME = true;
  return gulp.src('build/test/a-specs.js')
    .pipe(mocha())
    .on('error', spawnWatcher.handleError);
});

clear terminal

Terminal is cleared by default. To avoid that call:

spawnWatcher.clear(false);

Keywords

FAQs

Package last updated on 08 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc