@@ -12,44 +12,25 @@ describe("read_csv", async function () {
1212 } ) ;
1313} ) ;
1414
15- // describe("read_json", async function () {
16- // this.timeout(10000); // all tests in this suite get 10 seconds before timeout
17- // it("reads a json file from source over the internet", async function () {
18- // const jUrl =
19- // "https://raw.githubusercontent.com/risenW/Tensorflowjs_Projects/master/recommender-sys/Python-Model/web_book_data.json";
20-
21- // dfd.read_json(jUrl).then((df) => {
22- // const num_of_columns = df.column_names.length;
23- // assert.equal(num_of_columns, 4);
24- // });
25- // });
26-
27- // it("reads a json file from source from local disk", async function () {
28- // const jUrl = "danfojs/tests/samples/book.json";
15+ describe ( "read_json" , async function ( ) {
16+ this . timeout ( 10000 ) ; // all tests in this suite get 10 seconds before timeout
17+ it ( "reads a json file from source over the internet" , async function ( ) {
18+ const jUrl =
19+ "https://raw.githubusercontent.com/risenW/Tensorflowjs_Projects/master/recommender-sys/Python-Model/web_book_data.json" ;
2920
30- // dfd.read_json(jUrl).then((df) => {
31- // const num_of_columns = df.column_names.length;
32- // assert.equal(num_of_columns, 4);
33- // });
34- // });
35- // });
21+ const df = await dfd . read_json ( jUrl ) ;
22+ const num_of_columns = df . column_names . length ;
23+ assert . equal ( num_of_columns , 4 ) ;
3624
37- // describe("read_excel", async function () {
38- // this.timeout(10000); // all tests in this suite get 10 seconds before timeout
39- // it("reads an excel file from source over the internet", async function () {
40- // const remote_url =
41- // "https://file-examples-com.github.io/uploads/2017/02/file_example_XLS_100.xls";
42- // dfd.read_excel({ source: remote_url }).then((df) => {
43- // assert(df.columns.length, 8);
44- // });
45- // });
25+ } ) ;
26+ } ) ;
4627
47- // it("reads an excel file from source from local disk ", async function () {
48- // const file_url = "danfojs/tests/samples/SampleData.xlsx";
49- // dfd.read_excel({ source: file_url, header_index: 7, data_index: 8 }).then(
50- // (df) => {
51- // assert(df.columns.length, 4) ;
52- // }
53- // );
54- // });
55- // });
28+ describe ( "read_excel ", async function ( ) {
29+ this . timeout ( 10000 ) ; // all tests in this suite get 10 seconds before timeout
30+ it ( "reads an excel file from source over the internet" , async function ( ) {
31+ const remote_url =
32+ "https://file-examples-com.github.io/uploads/2017/02/file_example_XLS_100.xls" ;
33+ const df = await dfd . read_excel ( remote_url ) ;
34+ assert ( df . columns . length , 8 ) ;
35+ } ) ;
36+ } ) ;
0 commit comments