Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion lib/run/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,21 @@ var _ = require('lodash'),
*/
extractModel = function (source, type) {
source = source[type] || source; // extract object that holds variable. these usually come from cloud API

if (_.isObject(source) && !source.values) {
// Check if the source is an object and doesn't have a "values" property
// If it's an object, unwrap it if needed
source = source.collection || source;
}

if (!_.isObject(source)) {
return undefined;
}

// ensure we un-box the JSON if it comes from cloud-api or similar sources
!source.values && _.isObject(source[type]) && (source = source[type]);
if (!source.values && _.isObject(source[type])) {
source = source[type];
}

// we ensure that environment passed as array is converted to plain object. runtime does this too, but we do it
// here for consistency of options passed to reporters
Expand Down