Uint8Array migration
This commit is contained in:
parent
daf75190b8
commit
4ef0bf96cc
137 changed files with 2202 additions and 3170 deletions
|
@ -4,8 +4,6 @@
|
|||
import { assert } from 'chai';
|
||||
import { size } from '../../util/iterables';
|
||||
|
||||
import { typedArrayToArrayBuffer } from '../../Crypto';
|
||||
|
||||
import { getProvisioningUrl } from '../../util/getProvisioningUrl';
|
||||
|
||||
// It'd be nice to run these tests in the renderer, too, but [Chromium's `URL` doesn't
|
||||
|
@ -17,7 +15,7 @@ describe('getProvisioningUrl', () => {
|
|||
const uuid = 'a08bf1fd-1799-427f-a551-70af747e3956';
|
||||
const publicKey = new Uint8Array([9, 8, 7, 6, 5, 4, 3]);
|
||||
|
||||
const result = getProvisioningUrl(uuid, typedArrayToArrayBuffer(publicKey));
|
||||
const result = getProvisioningUrl(uuid, publicKey);
|
||||
const resultUrl = new URL(result);
|
||||
|
||||
assert.strictEqual(resultUrl.protocol, 'sgnl:');
|
||||
|
|
|
@ -13,8 +13,6 @@ import {
|
|||
IMAGE_WEBP,
|
||||
} from '../../types/MIME';
|
||||
|
||||
import { typedArrayToArrayBuffer } from '../../Crypto';
|
||||
|
||||
import { sniffImageMimeType } from '../../util/sniffImageMimeType';
|
||||
|
||||
describe('sniffImageMimeType', () => {
|
||||
|
@ -89,11 +87,4 @@ describe('sniffImageMimeType', () => {
|
|||
IMAGE_JPEG
|
||||
);
|
||||
});
|
||||
|
||||
it('handles ArrayBuffers', async () => {
|
||||
const arrayBuffer = typedArrayToArrayBuffer(
|
||||
await fixture('kitten-1-64-64.jpg')
|
||||
);
|
||||
assert.strictEqual(sniffImageMimeType(arrayBuffer), IMAGE_JPEG);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue