Skip to content

Latest commit

 

History

History
291 lines (208 loc) · 6.61 KB

File metadata and controls

291 lines (208 loc) · 6.61 KB

setup-cli-build

Usage

npx ember-cli-code-coverage-setup-codemod setup-cli-build path/of/files/ or/some**/*glob.js

# or

yarn global add ember-cli-code-coverage-setup-codemod
ember-cli-code-coverage-setup-codemod setup-cli-build path/of/files/ or/some**/*glob.js

Local Usage

node ./bin/cli.js setup-cli-build path/of/files/ or/some**/*glob.js

Input / Output


test-already-setup

Input (test-already-setup.input.js):

'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const codeCoverage = require('ember-cli-code-coverage');


module.exports = function (defaults) {
  let app = new EmberApp(defaults, {
    babel: {
      plugins: [
        ...codeCoverage.buildBabelPlugin({ embroider: !!process.env.EMBROIDER })
      ],
    },
  });

  // additional configuration

  return app.toTree();
};

Output (test-already-setup.output.js):

'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const codeCoverage = require('ember-cli-code-coverage');


module.exports = function (defaults) {
  let app = new EmberApp(defaults, {
    babel: {
      plugins: [
        ...codeCoverage.buildBabelPlugin({ embroider: !!process.env.EMBROIDER })
      ],
    },
  });

  // additional configuration

  return app.toTree();
};

test-with-babel-property

Input (test-with-babel-property.input.js):

'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');


module.exports = function (defaults) {
  let app = new EmberApp(defaults, {
    babel: {},
  });

  // additional configuration

  return app.toTree();
};

Output (test-with-babel-property.output.js):

'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');


module.exports = function (defaults) {
  let app = new EmberApp(defaults, {
    babel: {
      plugins: [...require('ember-cli-code-coverage').buildBabelPlugin({
        embroider: !!process.env.EMBROIDER,
      })],
    },
  });

  // additional configuration

  return app.toTree();
};

test-with-individual-options

Input (test-with-individual-options.input.js):

'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');


module.exports = function (defaults) {
  const options = {
    emberHighCharts: {
      includeHighCharts: true,
      includeHighStock: false,
      includeHighChartsMore: true,
      includeHighCharts3D: true,
      includeModules: ['solid-gauge'],
    },
  }

  let app = new EmberApp(defaults, options);

  // additional configuration

  return app.toTree();
};

Output (test-with-individual-options.output.js):

'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');


module.exports = function (defaults) {
  const options = {
    emberHighCharts: {
      includeHighCharts: true,
      includeHighStock: false,
      includeHighChartsMore: true,
      includeHighCharts3D: true,
      includeModules: ['solid-gauge'],
    },

    babel: {
      plugins: [...require('ember-cli-code-coverage').buildBabelPlugin({
        embroider: !!process.env.EMBROIDER,
      })],
    },
  }

  let app = new EmberApp(defaults, options);

  // additional configuration

  return app.toTree();
};

test-with-plugin-property

Input (test-with-plugin-property.input.js):

'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');


module.exports = function (defaults) {
  let app = new EmberApp(defaults, {
    babel: {
      plugins: [],
    },
  });

  // additional configuration

  return app.toTree();
};

Output (test-with-plugin-property.output.js):

'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');


module.exports = function (defaults) {
  let app = new EmberApp(defaults, {
    babel: {
      plugins: [...require('ember-cli-code-coverage').buildBabelPlugin({
        embroider: !!process.env.EMBROIDER,
      })],
    },
  });

  // additional configuration

  return app.toTree();
};

test-without-babel-property

Input (test-without-babel-property.input.js):

'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');


module.exports = function (defaults) {
  let app = new EmberApp(defaults, {
    emberHighCharts: {
      includeHighCharts: true,
      includeHighStock: false,
      includeHighChartsMore: true,
      includeHighCharts3D: true,
      includeModules: ['solid-gauge'],
    },
  });

  // additional configuration

  return app.toTree();
};

Output (test-without-babel-property.output.js):

'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');


module.exports = function (defaults) {
  let app = new EmberApp(defaults, {
    emberHighCharts: {
      includeHighCharts: true,
      includeHighStock: false,
      includeHighChartsMore: true,
      includeHighCharts3D: true,
      includeModules: ['solid-gauge'],
    },

    babel: {
      plugins: [...require('ember-cli-code-coverage').buildBabelPlugin({
        embroider: !!process.env.EMBROIDER,
      })],
    },
  });

  // additional configuration

  return app.toTree();
};