var path = require('path');

var framework = function(files) {
    files.unshift({
        pattern: path.resolve(require.resolve('chai-spies')).replace(/[^\/\\]*$/, 'chai-spies.js'),
        included: true,
        served: true,
        watched: false
    });
};

framework.$inject = ['config.files'];
module.exports = {'framework:chai-spies': ['factory', framework]};

var path = require('path');

var framework = function(files) {
    files.unshift({
        pattern: require.resolve('chai-spies/chai-spies'),
        included: true,
        served: true,
        watched: false
    });
};

framework.$inject = ['config.files'];
module.exports = {'framework:chai-spies': ['factory', framework]};

Improve file path detection for chai-spies
Improve file path detection for chai-spies

This changes the previous RegEx replacement to instead use Node's require pattern to correctly find the chai-spies.js file. `path.resolve` has also been removed as `require.resolve` always returns an absolute path.