mirror of
https://github.com/Modernizr/Modernizr.git
synced 2026-01-09 15:47:55 -05:00
add fix for custom tests
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
Reference in New Issue
Block a user