@@ -19,7 +19,7 @@ import { compressImage } from "../../src/imageOperations";
1919import { compressPdf } from "../../src/pdf" ;
2020import { extractTextFromPdf } from "../../src/pdf/pdfUtils" ;
2121import { logger } from "../../src/logger" ;
22- import { RESOURCE_PATH } from "../index" ;
22+ import { RESOURCE_PATH , V1_PRODUCT_PATH } from "../index" ;
2323
2424describe ( "Test different types of input" , ( ) => {
2525 const outputPath = path . join ( RESOURCE_PATH , "output" ) ;
@@ -55,12 +55,12 @@ describe("Test different types of input", () => {
5555
5656 it ( "should accept JPEG files from a path" , async ( ) => {
5757 const inputSource = new PathInput ( {
58- inputPath : path . join ( RESOURCE_PATH , "products/ expense_receipts/default_sample.jpg" ) ,
58+ inputPath : path . join ( V1_PRODUCT_PATH , "expense_receipts/default_sample.jpg" ) ,
5959 } ) ;
6060 await inputSource . init ( ) ;
6161
6262 const expectedResult = await fs . promises . readFile (
63- path . join ( RESOURCE_PATH , "products/ expense_receipts/default_sample.jpg" )
63+ path . join ( V1_PRODUCT_PATH , "expense_receipts/default_sample.jpg" )
6464 ) ;
6565 expect ( inputSource . inputType ) . to . equals ( INPUT_TYPE_PATH ) ;
6666 expect ( inputSource . filename ) . to . equals ( "default_sample.jpg" ) ;
@@ -103,7 +103,7 @@ describe("Test different types of input", () => {
103103 } ) ;
104104
105105 it ( "should accept read streams" , async ( ) => {
106- const filePath = path . join ( RESOURCE_PATH , "products/ expense_receipts/default_sample.jpg" ) ;
106+ const filePath = path . join ( V1_PRODUCT_PATH , "expense_receipts/default_sample.jpg" ) ;
107107 const stream = fs . createReadStream ( filePath ) ;
108108 const filename = "default_sample.jpg" ;
109109 const inputSource = new StreamInput ( {
@@ -121,7 +121,7 @@ describe("Test different types of input", () => {
121121 } ) ;
122122
123123 it ( "should accept raw bytes" , async ( ) => {
124- const filePath = path . join ( RESOURCE_PATH , "products/ expense_receipts/default_sample.jpg" ) ;
124+ const filePath = path . join ( V1_PRODUCT_PATH , "expense_receipts/default_sample.jpg" ) ;
125125 const inputBytes = await fs . promises . readFile ( filePath ) ;
126126 // don't provide an extension to see if we can detect MIME
127127 // type based on contents
@@ -144,7 +144,7 @@ describe("Test different types of input", () => {
144144 const filename = "invoice_01.pdf" ;
145145 const buffer = Buffer . from (
146146 await fs . promises . readFile (
147- path . join ( RESOURCE_PATH , "products/ invoices/invoice_10p.pdf" )
147+ path . join ( V1_PRODUCT_PATH , "invoices/invoice_10p.pdf" )
148148 )
149149 ) ;
150150 const inputSource = new BufferInput ( {
@@ -257,7 +257,7 @@ describe("Test different types of input", () => {
257257
258258 it ( "PDF Compress From InputSource" , async ( ) => {
259259 const pdfResizeInput = new PathInput (
260- { inputPath : path . join ( RESOURCE_PATH , "products/ invoice_splitter/default_sample.pdf" ) }
260+ { inputPath : path . join ( V1_PRODUCT_PATH , "invoice_splitter/default_sample.pdf" ) }
261261 ) ;
262262 await pdfResizeInput . init ( ) ;
263263
@@ -267,10 +267,7 @@ describe("Test different types of input", () => {
267267 await fs . promises . writeFile ( path . join ( outputPath , "resize_indirect.pdf" ) , compressedPdf ) ;
268268
269269 const initialFileStats = await fs . promises . stat (
270- path . join (
271- RESOURCE_PATH ,
272- "products/invoice_splitter/default_sample.pdf"
273- )
270+ path . join ( V1_PRODUCT_PATH , "invoice_splitter/default_sample.pdf" )
274271 ) ;
275272 const renderedFileStats = await fs . promises . stat (
276273 path . join ( outputPath , "resize_indirect.pdf" )
@@ -280,7 +277,7 @@ describe("Test different types of input", () => {
280277
281278 it ( "PDF Compress From Compressor" , async ( ) => {
282279 const pdfResizeInput = new PathInput (
283- { inputPath : path . join ( RESOURCE_PATH , "products/ invoice_splitter/default_sample.pdf" ) }
280+ { inputPath : path . join ( V1_PRODUCT_PATH , "invoice_splitter/default_sample.pdf" ) }
284281 ) ;
285282 await pdfResizeInput . init ( ) ;
286283
@@ -297,7 +294,7 @@ describe("Test different types of input", () => {
297294 }
298295
299296 const initialFileStats = await fs . promises . stat (
300- path . join ( RESOURCE_PATH , "products/ invoice_splitter/default_sample.pdf" )
297+ path . join ( V1_PRODUCT_PATH , "invoice_splitter/default_sample.pdf" )
301298 ) ;
302299 const renderedFileStats = await Promise . all (
303300 fileNames . map ( fileName => fs . promises . stat ( path . join ( outputPath , fileName ) ) )
0 commit comments