Skip to content

Commit b67f64d

Browse files
committed
Update tests
1 parent 2a06143 commit b67f64d

3 files changed

Lines changed: 5 additions & 68 deletions

File tree

danfojs/tests/config/config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/* eslint-disable no-undef */
2-
const config = new dfd.Configs();
32

43
describe("Config", function () {
4+
const config = new dfd.Configs();
5+
56
it("gets the default config val for table width", function () {
67
let table_width = config.get_width;
78
assert.equal(table_width, 17);

danfojs/tests/core/utils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
const utils = new dfd.Utils;
1+
/* eslint-disable no-undef */
22

33

44
describe("Utils Functions", function () {
5+
const utils = new dfd.Utils;
6+
57
it("removes an element from an array", function () {
68
let arr = [ 1, 2, 3, 4 ];
79
assert.deepEqual(utils.remove(arr, 2), [ 1, 2, 4 ]);

danfojs/tests/io/reader.js

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -62,69 +62,3 @@ describe("read_excel", async function () {
6262
);
6363
});
6464
});
65-
66-
describe("read: Generic read function from frictionless.js", async function () {
67-
this.timeout(20000); // all tests in this suite get 10 seconds before timeout
68-
69-
it("read an excel file from source over the internet", async function () {
70-
const remote_url =
71-
"https://file-examples-com.github.io/uploads/2017/02/file_example_XLS_100.xls";
72-
dfd.read(remote_url).then((df) => {
73-
assert(df.columns.length, 8);
74-
});
75-
});
76-
77-
it("read an excel file from source from local disk", async function () {
78-
const file_url = "danfojs/tests/samples/SampleData.xlsx";
79-
dfd.read(file_url).then((df) => {
80-
assert(df.columns.length, 4);
81-
});
82-
});
83-
84-
it("read a csv file from source over the internet", async function () {
85-
const csvUrl =
86-
"https://storage.googleapis.com/tfjs-examples/multivariate-linear-regression/data/boston-housing-train.csv";
87-
88-
dfd.read(csvUrl).then((df) => {
89-
const num_of_columns = df.column_names.length;
90-
assert.equal(num_of_columns, 13);
91-
});
92-
});
93-
94-
it("read a csv file from source from local disk", async function () {
95-
const csvUrl = "danfojs/tests/samples/titanic.csv";
96-
97-
dfd.read(csvUrl).then((df) => {
98-
const num_of_columns = df.column_names.length;
99-
assert.equal(num_of_columns, 8);
100-
});
101-
});
102-
it("read a csv file from source from local disk with header set to false", async function () {
103-
const csvUrl = "danfojs/tests/samples/titanic.csv";
104-
105-
dfd.read(csvUrl, { header: false }).then((df) => {
106-
const num_of_columns = df.column_names.length;
107-
assert.equal(num_of_columns, 8);
108-
});
109-
});
110-
111-
it("read a Dataset package", async function () {
112-
const jUrl =
113-
"https://raw.githubusercontent.com/frictionlessdata/frictionless-js/master/test/fixtures/co2-ppm/datapackage.json";
114-
115-
dfd.read(jUrl).then((df) => {
116-
const num_of_columns = df.column_names.length;
117-
assert.equal(num_of_columns, 6);
118-
});
119-
});
120-
121-
it("read a specific data from Dataset package", async function () {
122-
const jUrl =
123-
"https://raw.githubusercontent.com/frictionlessdata/frictionless-js/master/test/fixtures/co2-ppm/datapackage.json";
124-
125-
dfd.read(jUrl, { data_num: 2 }).then((df) => {
126-
const num_of_columns = df.column_names.length;
127-
assert.equal(num_of_columns, 3);
128-
});
129-
});
130-
});

0 commit comments

Comments
 (0)