Skip to content

Commit 17afa47

Browse files
authored
Merge pull request #88 from bad4iz/feature/затестировать-toBase64.js_#19
#19: затестировать toBase64.js
2 parents 39fe081 + b685d46 commit 17afa47

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/component/utils/toBase64.spec.ts

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { describe, expect, it } from 'vitest';
2+
3+
import { toBase64 } from './toBase64';
4+
describe('toBase64', () => {
5+
it('default', async () => {
6+
expect.hasAssertions();
7+
// ☣️ Arrange (всякие моки)
8+
const file = new File(['foo'], 'foo.txt', {
9+
type: 'text/plain',
10+
});
11+
//🔥 Act
12+
const res = await toBase64(file);
13+
14+
//❓ Assert
15+
expect(res).toBe('data:text/plain;base64,Zm9v');
16+
});
17+
});

0 commit comments

Comments
 (0)