Skip to content

Commit

Permalink
Add mock generator util tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunalpal216 committed Nov 7, 2024
1 parent b46bdaa commit 7766328
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions scripts/__mocks__/@pdfme/generator.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { generate } from './generator';

describe('Testing mock generate util', () => {
test('should return a Promise', async () => {
const result = generate();
expect(result).toBeInstanceOf(Promise);
});

test('should resolve to a Uint8Array', async () => {
const result = await generate();
expect(result).toBeInstanceOf(Uint8Array);
});

test('should resolve to a Uint8Array with correct values', async () => {
const result = await generate();
expect(result).toEqual(new Uint8Array([10, 20, 30, 40, 50]));
});
});

0 comments on commit 7766328

Please sign in to comment.