Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't print a warning when loadAll is not set #3303

Merged
merged 1 commit into from
Aug 7, 2024
Merged
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
18 changes: 9 additions & 9 deletions packages/core/lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,23 +407,23 @@ function datafileVariables(script) {
let result = {};
if (script.config.payload) {
_.each(script.config.payload, function (el) {
//when loading all the csv, we don't set individual fields
if (!el.loadAll) {
// Load individual fields from the CSV into VU context variables
// If data = [] (i.e. the CSV file is empty, or only has headers and
// skipHeaders = true), then row could = undefined
let row = el.reader(el.data) || [];
_.each(el.fields, function (fieldName, j) {
result[fieldName] = row[j];
});
}

if (typeof el.name !== 'undefined') {
// Make the entire CSV available
result[el.name] = el.reader(el.data);
} else {
console.log(
'WARNING: loadAll is set to true but no name is provided for the CSV data'
);
if (typeof el.name !== 'undefined') {
// Make the entire CSV available
result[el.name] = el.reader(el.data);
} else {
console.log(
'WARNING: loadAll is set to true but no name is provided for the CSV data'
);
}
}
});
}
Expand Down
Loading