Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ src/interpreter/plugin/3rdparty
*.config.js
karma.*
doc
test/unit/_setupFiles/*.js

# Auto-generated directories
commonjs
Expand All @@ -25,4 +26,3 @@ test-jasmine
test-jest
typedoc
typings
test/_setupFiles/*.js
9 changes: 9 additions & 0 deletions DEV_DOCS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Dev Docs

Random notes and things to know useful for maintainers and contributors.

## Sources of the function translations

HF supports internationalization and provides the localized function names for all built-in languages. When looking for the valid translations for the new functions, try these sources:
- https://support.microsoft.com/en-us/office/excel-functions-translator-f262d0c0-991c-485b-89b6-32cc8d326889
- http://dolf.trieschnigg.nl/excel/index.php
13 changes: 8 additions & 5 deletions docs/guide/file-import.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To import XLSX files, use a third-party [XLSX parser](https://www.npmjs.com/sear

### Example: Import XLSX files in Node

This example uses [ExcelJS](https://www.npmjs.com/package/exceljs) to import XLSX files into HyperFormula.
This example uses [ExcelJS](https://www.npmjs.com/package/exceljs) to import XLSX files into HyperFormula.

See full example on [GitHub](https://github.com/handsontable/hyperformula-demos/tree/3.0.x/read-excel-file).

Expand All @@ -43,18 +43,21 @@ function convertXlsxWorkbookToJavascriptArrays(workbook) {
const workbookData = {};

workbook.eachSheet((worksheet) => {
const sheetDimensions = worksheet.dimensions
const sheetData = [];

worksheet.eachRow((row) => {
for (let rowNum = sheetDimensions.top; rowNum <= sheetDimensions.bottom; rowNum++) {
const rowData = [];

row.eachCell((cell) => {
for (let colNum = sheetDimensions.left; colNum <= sheetDimensions.right; colNum++) {
const cell = worksheet.getCell(rowNum, colNum)

const cellData = cell.formula ? `=${cell.formula}` : cell.value;
rowData.push(cellData);
});
}

sheetData.push(rowData);
});
}

workbookData[worksheet.name] = sheetData;
})
Expand Down
10 changes: 5 additions & 5 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ module.exports = {
coverageDirectory: "coverage",

// A path to a module which exports an async function that is triggered once before all test suites
globalSetup: '<rootDir>/test/_setupFiles/globalSetup.ts',
globalSetup: '<rootDir>/test/unit/_setupFiles/globalSetup.ts',

// A set of global variables that need to be available in all test environments
globals: {
"ts-jest": {
"tsconfig": "./test/tsconfig.json"
"tsconfig": "./test/unit/tsconfig.json"
}
},

Expand All @@ -32,16 +32,16 @@ module.exports = {

// The paths to modules that run some code to configure or set up the testing environment after each test
setupFilesAfterEnv: [
'<rootDir>/test/_setupFiles/bootstrap.ts',
'<rootDir>/test/_setupFiles/jest/bootstrap.ts'
'<rootDir>/test/unit/_setupFiles/bootstrap.ts',
'<rootDir>/test/unit/_setupFiles/jest/bootstrap.ts'
],

// The test environment that will be used for testing
testEnvironment: "node",

// The glob patterns Jest uses to detect test files
testMatch: [
"<rootDir>/test/**/*spec.(ts|js)"
"<rootDir>/test/unit/**/*spec.(ts|js)"
],

silent: true,
Expand Down
4 changes: 2 additions & 2 deletions karma.starter.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import './test/_setupFiles/bootstrap';
import './test/unit/_setupFiles/bootstrap';

//@ts-ignore
const specArg: string = __karma__.config.spec;

// require all modules ending in ".spec.ts" from the
// './test' directory and all subdirectories
const testsContext = require.context('./test', true, /.spec.ts$/);
const testsContext = require.context('./test/unit', true, /.spec.ts$/);
let files = testsContext.keys();

if (specArg) {
Expand Down
Loading
Loading