@buxlabs/before-all-to-es6
convert jasmine spec with before all to es6
Last updated 3 years ago by buxlabs .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @buxlabs/before-all-to-es6 
SYNC missed versions from official npm registry.

before-all-to-es6

Convert specs with beforeAll to ES6

Installation

npm install -g @buxlabs/before-all-to-es6

Usage

Convert a single file with:

batoes6 app.js > app-es6.js

Convert multiple files in given dir with:

batoes6 --src=src --dest=build

Convert multiple files in given dir recursively with:

batoes6 --src=src --dest=build --glob=**/*.js

Convert multiple files and replace them with:

batoes6 --src=src --replace

Examples:

SPEC

describe('one dependency', function () {

    var Backbone;

    beforeAll(function (done) {
        require(['backbone'], function () {
           Backbone = arguments[0];
           done();
        });
    });

    it('should be defined', function () {
        expect(Backbone).toBeDefined();
    });

});

ES6

import Backbone from 'backbone';

describe('one dependency', function () {

    it('should be defined', function () {
        expect(Backbone).toBeDefined();
    });

});

There are more examples in the test/fixture directory

Options


  Usage: batoes6 [options]

  Options:

    -s, --src <dirname>     Directory of the source files
    -d, --dest <dirname>    Directory of the destination files
    -g, --glob [glob]       Glob pattern for the src to match for input files
    -r, --recursive         Set glob pattern to **/*.js with no hassle
    -b, --beautify          Beautify the output
    --quotes            Single, double or auto quotes in the output
    --replace           Replace the input files with results

Current Tags

  • 0.2.0                                ...           latest (3 years ago)

4 Versions

  • 0.2.0                                ...           3 years ago
  • 0.1.3                                ...           3 years ago
  • 0.1.2                                ...           3 years ago
  • 0.1.1                                ...           3 years ago
Maintainers (2)
Downloads
Today 0
This Week 4
This Month 4
Last Day 0
Last Week 1
Last Month 7
Dependencies (3)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |