phodal/growth

View on GitHub
__tests__/helpers/html-transform.js

Summary

Maintainability
A
2 hrs
Test Coverage
const babel = require('babel-core');
const jestPreset = require('babel-preset-jest');

module.exports = {
  process(src, filename) {
    if (babel.util.canCompile(filename)) {
      return babel.transform(src, {
        filename,
        presets: [jestPreset],
        retainLines: true,
      }).code;
    }
    return src;
  },
};