@buxlabs/jasmine-converter
A convestion utility for jasmine
Last updated 3 years ago by buxlabs .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @buxlabs/jasmine-converter 
SYNC missed versions from official npm registry.

jasmine-converter

Greenkeeper badge

Installation

npm install -g @buxlabs/jasmine-converter

What does it do?

The library was created to convert jasmine specs from the following format:

describe("Test", function () {
    var a;
    
    beforeEach(function () {
        a = 5; 
    });
    
    it("works", function () {
        expect(a).toBe(5);
    });
});

to:

describe("Test", function () {
    beforeEach(function () {
        this.a = 5; 
    });
    
    it("works", function () {
        expect(this.a).toBe(5);
    });
});

The difference between formats is that the first one causes memory leaks due to the internal design of the library, the second one is the suggested solution to the problem.

Usage

cli

Convert a single file with:

jasmineconverter app.spec.js > app.spec.js

Convert multiple files in given dir recursively and replace them with:

jasmineconverter --src=src --glob=**/*.spec.js --replace

Options


  Usage: jasmineconverter [options]

  Options:

    -s, --src <dirname>     Directory of the source files
    -g, --glob [glob]       Glob pattern for the src to match for input files
    -r, --recursive         Set glob pattern to **/*.js with no hassle
    --replace               Replace the input files with results

Current Tags

  • 0.3.3                                ...           latest (3 years ago)

4 Versions

  • 0.3.3                                ...           3 years ago
  • 0.3.2                                ...           3 years ago
  • 0.3.1                                ...           3 years ago
  • 0.3.0                                ...           3 years ago
Maintainers (2)
Downloads
Today 0
This Week 1
This Month 5
Last Day 1
Last Week 4
Last Month 3
Dependencies (3)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |