import { Test, TestingModule } from '@nestjs/testing'
import { ChatPdfService } from './chat-pdf.service'
import { readFileSync } from 'fs'
jest.useFakeTimers()

describe('ChatPdfService', () => {
    let service: ChatPdfService

    beforeEach(async () => {
        const module: TestingModule = await Test.createTestingModule({
            providers: [ChatPdfService]
        }).compile()

        service = module.get<ChatPdfService>(ChatPdfService)
    })

    it('should be defined', () => {
        expect(service).toBeDefined()
    })

    describe('parse', () => {
        it('parse', async () => {
            expect(service).toBeDefined()
            console.log(
                await service.parsePdf(readFileSync('/Users/drew/Downloads/《Python 3学习笔记（上卷）》_1-50.pdf'))
            )
        })
    })
})
