@@ -23,14 +23,22 @@ describe("read_csv", async function () {
2323} ) ;
2424
2525describe ( "read_json" , async function ( ) {
26- this . timeout ( 10000 ) ; // all tests in this suite get 10 seconds before timeout
26+ this . timeout ( 100000 ) ; // all tests in this suite get 10 seconds before timeout
2727 it ( "reads a json file from source over the internet" , async function ( ) {
2828 const jUrl =
29- "https://raw.githubusercontent.com/risenW/Tensorflowjs_Projects/master/recommender-sys/Python-Model/web_book_data .json" ;
29+ "https://raw.githubusercontent.com/opensource9ja/danfojs/dev/danfojs-node/tests/samples/book .json" ;
3030
3131 const df = await read_json ( jUrl ) ;
32- const num_of_columns = df . columns . length ;
33- assert . equal ( num_of_columns , 4 ) ;
32+ assert . deepEqual ( df . columns , [
33+ 'book_id' ,
34+ 'title' ,
35+ 'image_url' ,
36+ 'authors'
37+ ] ) ;
38+ assert . deepEqual ( df . dtypes , [
39+ 'int32' , 'string' ,
40+ 'string' , 'string'
41+ ] ) ;
3442
3543 } ) ;
3644
@@ -47,9 +55,19 @@ describe("read_excel", async function () {
4755 this . timeout ( 10000 ) ; // all tests in this suite get 10 seconds before timeout
4856 it ( "reads an excel file from source over the internet" , async function ( ) {
4957 const remote_url =
50- "https://file-examples-com.github.io/uploads/2017/02/file_example_XLS_100.xls" ;
51- const df = await read_excel ( remote_url , { sheet : 0 } ) ;
52- assert ( df . columns . length , 8 ) ;
58+ "https://raw.githubusercontent.com/opensource9ja/danfojs/dev/danfojs-node/tests/samples/SampleData.xlsx" ;
59+ const df = await read_excel ( remote_url ) ;
60+ assert . deepEqual ( df . columns , [
61+ 'Year' ,
62+ 'Stocks' ,
63+ 'T.Bills' ,
64+ 'T.Bonds'
65+ ] ) ;
66+ assert . deepEqual ( df . dtypes , [
67+ 'int32' , 'float32' ,
68+ 'float32' , 'float32'
69+ ] ) ;
70+ assert . deepEqual ( df . shape , [ 82 , 4 ] ) ;
5371 } ) ;
5472
5573 it ( "reads an excel file from source from local disk" , async function ( ) {
0 commit comments