summaryrefslogtreecommitdiff
path: root/spec/frontend/__helpers__/yaml_transformer.js
blob: e0b4d01f542ca9a3b29f67be01d3bb3c24b89d76 (plain)
1
2
3
4
5
6
7
8
9
10
11
/* eslint-disable import/no-commonjs */
const JsYaml = require('js-yaml');

// This will transform YAML files to JSON strings
module.exports = {
  process: (sourceContent) => {
    const jsonContent = JsYaml.load(sourceContent);
    const json = JSON.stringify(jsonContent);
    return { code: `module.exports = ${json}` };
  },
};