Skip to content

Commit

Permalink
test: use markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
rpidanny committed Jul 12, 2024
1 parent fb074a3 commit df3719b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/services/pdf/pdf.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { jest } from '@jest/globals'
import { readFileSync } from 'fs'
import { readFile } from 'fs/promises'
import { mock } from 'jest-mock-extended'
import { dirname, join } from 'path'
Expand Down Expand Up @@ -40,7 +41,14 @@ describe('PdfService', () => {
describe('getMarkdownContent', () => {
it('should get markdown content from PDF', async () => {
const content = await pdfService.getMarkdownContent('https://example.com')
expect(content).toContain('The new frontier of genome engineering with CRISPR-Cas9')
const markDown = readFileSync(
join(
__dirname,
'../../../test/data/papers/The-new-frontier-of-genome-engineering-with-CRISPR-Cas9.md',
),
'utf-8',
)
expect(content).toContain(markDown)
})
})
})

0 comments on commit df3719b

Please sign in to comment.