add fix for custom tests

This commit is contained in:
Patrick Kettner
2015-12-09 13:39:14 -08:00
parent a4c50e2d02
commit 990d91e817
2 changed files with 21 additions and 8 deletions

View File

@@ -14,14 +14,19 @@ define(['lodash', 'metadata'], function(_, metadata) {
var dontmin = !config.minify;
// Config uses amdPaths, but build query uses property names
var props = _.map(config['feature-detects'], function(amdPath) {
var detect = getDetectObjByAmdPath(amdPath);
var property = detect && detect.property;
property = _.isArray(property) ?
property.join('_').replace('-', '_') :
property.replace('-', '_');
return property;
});
var props = _.chain(config['feature-detects'])
.map(function(amdPath) {
var detect = getDetectObjByAmdPath(amdPath);
var property = detect && detect.property;
if (property) {
property = _.isArray(property) ?
property.join('_').replace('-', '_') :
property.replace('-', '_');
return property;
}
})
.filter()
.value();
// Config uses amdPaths, but the option's just use their names.
// A few of the values have to be massaged in order to match

View File

@@ -79,6 +79,14 @@ describe('build-query', function() {
expect(query).to.be('?-');
});
it('removes custom tests from the build query', function() {
var query = buildQuery({
'feature-detects': ['css/boxsizing', 'custom/test/path']
});
expect(query).to.be('?-boxsizing-dontmin');
});
after(function() {
cleanup();
});