Skip to content

Commit

Permalink
Add default first line support
Browse files Browse the repository at this point in the history
  • Loading branch information
slemarchand committed Nov 1, 2016
1 parent a484430 commit dee8da6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/xlsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var extractFromExcel = function(excelPath, config, path) {
*/

var defaultConfig = {

firstLine: 1,
escape: false
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"keyColumn": "B",
"valueColumn": "D",
"filter": {
"column": "C",
"value": "go"
}
}
20 changes: 20 additions & 0 deletions test/acceptance/xlsx-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,26 @@ describe("props from-xlsx", function() {

});

it("extract properties file from XLSX file, supporting default first line", function() {

var inputFilePath = base + '/from_xlsx_input.xlsx';

var configFilePath = base + '/from_xlsx_config_default_first_line.json';

var intoFilePath = base + '/from_xlsx_into.properties';

var expectedFilePath = base + '/from_xlsx_expected.properties';

main.run(['from-xlsx', inputFilePath, configFilePath, intoFilePath]);

var actualContent = fse.readFileSync(intoFilePath, 'utf8').toString();

var expectedContent = fse.readFileSync(expectedFilePath, 'utf8').toString();

expect(actualContent).to.equal(expectedContent);

});

it("extract properties file from XLSX file, supporting multiple sheets", function() {

var inputFilePath = base + '/from_xlsx_input_multiple_sheets.xlsx';
Expand Down

0 comments on commit dee8da6

Please sign in to comment.