launch-darkly-feature-builder
Advanced tools
Comparing version 0.19.1 to 0.20.0
{ | ||
"name": "launch-darkly-feature-builder", | ||
"version": "0.19.1", | ||
"version": "0.20.0", | ||
"description": "Builds and manages launch darkly features from code.", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -22,3 +22,6 @@ const _ = require( 'lodash' ); | ||
const normal = _.omitBy( clause, isInternalField ); | ||
const normal = _.omit( | ||
_.omitBy( clause, isInternalField ), | ||
'id' | ||
); | ||
return normal; | ||
@@ -25,0 +28,0 @@ } |
@@ -157,2 +157,69 @@ const assert = require( './util/assert.js' ); | ||
it( 'should strip out rule clauses id field', function() { | ||
const feature = deepFreeze( { | ||
environments: { | ||
test: { | ||
rules: [ | ||
{ | ||
clauses: [ | ||
{ | ||
attribute: 'field', | ||
op: 'in', | ||
values: [ 'value' ], | ||
negate: false, | ||
id: '' | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} ); | ||
const normalized = featureNormalizer( feature ); | ||
assert.deepEqual( normalized, { | ||
description: '', | ||
archived: false, | ||
includeInSnippet: false, | ||
temporary: true, | ||
tags: [], | ||
goalIds: [], | ||
customProperties: {}, | ||
experiments: { | ||
baselineIdx: 0, | ||
items: [] | ||
}, | ||
environments: { | ||
test: { | ||
archived: false, | ||
fallthrough: { | ||
variation: 0 | ||
}, | ||
offVariation: 0, | ||
on: true, | ||
prerequisites: [], | ||
targets: [], | ||
trackEvents: false, | ||
trackEventsFallthrough: false, | ||
rules: [ | ||
{ | ||
clauses: [ | ||
{ | ||
attribute: 'field', | ||
op: 'in', | ||
values: [ 'value' ], | ||
negate: false | ||
} | ||
], | ||
trackEvents: false | ||
} | ||
] | ||
} | ||
}, | ||
variations: [] | ||
} ); | ||
} ); | ||
it( 'should strip out environment _summary field', function() { | ||
@@ -159,0 +226,0 @@ |
57321
2295