ludc
2023-08-24 56c45e1f4be85d6bbfb3a03437021c6742b32ad9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var XLSX = require('../');
 
var tests = {
    'should be able to open workbook': function (file) {
        var xlsx = XLSX.readFile('tests/files/' + file);
        expect(xlsx).toBeTruthy();
        expect(xlsx).toEqual(jasmine.any(Object));
    },
    'should define all api properties correctly': function (file) {
        var xlsx = XLSX.readFile('tests/files/' + file);
        expect(xlsx.Workbook).toEqual(jasmine.any(Object));
        expect(xlsx.Props).toBeDefined();
        expect(xlsx.Deps).toBeDefined();
        expect(xlsx.Sheets).toEqual(jasmine.any(Object));
        expect(xlsx.SheetNames).toEqual(jasmine.any(Array));
        expect(xlsx.Strings).toBeDefined();
        expect(xlsx.Styles).toBeDefined();
    }
};
 
module.exports = function (file) {
    for (var key in tests) {
        it(key, tests[key].bind(undefined, file));
    }
};