@buxlabs/jasmine-converter

0.3.3 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i @buxlabs/jasmine-converter

Weekly Downloads

2

Version

0.3.3

License

MIT

Last publish

Collaborators

  • buxlabs-dev
  • emilos