1- import * as mindee from "@/index.js" ;
2- import { InvoiceV4 } from "@/v1/product/index.js" ;
1+ import { beforeEach , describe , it } from "node:test" ;
32import assert from "node:assert" ;
3+ import path from "path" ;
44import { promises as fs } from "fs" ;
55import { createReadStream } from "node:fs" ;
6- import path from "path" ;
6+ import * as mindee from "@/index.js" ;
7+ import { InvoiceV4 } from "@/v1/product/index.js" ;
78import { V1_PRODUCT_PATH } from "../../index.js" ;
89import { PathInput , Base64Input , BufferInput , BytesInput , UrlInput } from "@/index.js" ;
910
10- describe ( "MindeeV1 - Integration - File Input" , async ( ) => {
11+ describe ( "MindeeV1 - Integration - File Input" , { timeout : 60000 } , ( ) => {
1112 let client : mindee . v1 . Client ;
1213 let filePath : string ;
1314
@@ -21,15 +22,15 @@ describe("MindeeV1 - Integration - File Input", async () => {
2122 await pathInput . init ( ) ;
2223 const result = await client . parse ( InvoiceV4 , pathInput ) ;
2324 assert . strictEqual ( typeof result . document . id , "string" ) ;
24- } ) . timeout ( 60000 ) ;
25+ } ) ;
2526
2627 it ( "should send a base64 document" , async ( ) => {
2728 const content = await fs . readFile ( filePath ) ;
2829 const base64Content = content . toString ( "base64" ) ;
2930 const base64Input = new Base64Input ( { inputString : base64Content , filename : "testFile.jpg" } ) ;
3031 const result = await client . parse ( InvoiceV4 , base64Input ) ;
3132 assert . strictEqual ( typeof result . document . id , "string" ) ;
32- } ) . timeout ( 60000 ) ;
33+ } ) ;
3334
3435 it ( "should send a document from a readable stream" , async ( ) => {
3536 const fileStream = createReadStream ( filePath ) ;
@@ -41,23 +42,23 @@ describe("MindeeV1 - Integration - File Input", async () => {
4142 const streamInput = new BufferInput ( { buffer : buffer , filename : "testFile.jpg" } ) ;
4243 const result = await client . parse ( InvoiceV4 , streamInput ) ;
4344 assert . strictEqual ( typeof result . document . id , "string" ) ;
44- } ) . timeout ( 60000 ) ;
45+ } ) ;
4546
4647
4748 it ( "should send a document from bytes" , async ( ) => {
4849 const inputBytes = await fs . readFile ( filePath ) ;
4950 const bytesInput = new BytesInput ( { inputBytes : inputBytes , filename : "testFile.jpg" } ) ;
5051 const result = await client . parse ( InvoiceV4 , bytesInput ) ;
5152 assert . strictEqual ( typeof result . document . id , "string" ) ;
52- } ) . timeout ( 60000 ) ;
53+ } ) ;
5354
5455 it ( "should send a document from buffer" , async ( ) => {
5556 const buffer = await fs . readFile ( filePath ) ;
5657 const bufferInput = new BufferInput ( { buffer : buffer , filename : "testFile.jpg" } ) ;
5758 await bufferInput . init ( ) ;
5859 const result = await client . parse ( InvoiceV4 , bufferInput ) ;
5960 assert . strictEqual ( typeof result . document . id , "string" ) ;
60- } ) . timeout ( 60000 ) ;
61+ } ) ;
6162
6263 it ( "should send a document from a URL" , async ( ) => {
6364 const url = "https://raw.githubusercontent.com/mindee/client-lib-test-data/" +
@@ -66,5 +67,5 @@ describe("MindeeV1 - Integration - File Input", async () => {
6667 await urlInput . init ( ) ;
6768 const result = await client . parse ( InvoiceV4 , urlInput ) ;
6869 assert . strictEqual ( typeof result . document . id , "string" ) ;
69- } ) . timeout ( 60000 ) ;
70- } ) . timeout ( 60000 ) ;
70+ } ) ;
71+ } ) ;
0 commit comments