# all files / api/transformers/ step-definition-transformer.js

100% Statements 18/18
100% Branches 4/4
100% Functions 4/4
100% Lines 6/6

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

    1

    2

    1

    2
    1

     'use strict';

    // Utilities:
    import Promise from 'bluebird';

    // Dependencies:
    import fileStructure from '../../file-structure';
    import transforms from './transforms';

    export default function stepDefinitionTransformer (file, options) {
        let { oldPath, newPath } = options;

        let references = Object.keys(fileStructure.references)
        .filter((reference) => {
            return fileStructure.references[reference].includes(oldPath);
        });

        return Promise.map(references, (reference) => {
            return transforms.transformReferencePath(file, oldPath, reference, newPath, reference);
        });
    }