mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Eslintify all of libtextsecure
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
describe('Helpers', function() {
|
||||
describe('ArrayBuffer->String conversion', function() {
|
||||
it('works', function() {
|
||||
var b = new ArrayBuffer(3);
|
||||
var a = new Uint8Array(b);
|
||||
describe('Helpers', () => {
|
||||
describe('ArrayBuffer->String conversion', () => {
|
||||
it('works', () => {
|
||||
const b = new ArrayBuffer(3);
|
||||
const a = new Uint8Array(b);
|
||||
a[0] = 0;
|
||||
a[1] = 255;
|
||||
a[2] = 128;
|
||||
@@ -12,18 +10,18 @@ describe('Helpers', function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe('stringToArrayBuffer', function() {
|
||||
it('returns ArrayBuffer when passed string', function() {
|
||||
var StaticArrayBufferProto = new ArrayBuffer().__proto__;
|
||||
var anArrayBuffer = new ArrayBuffer(1);
|
||||
var typedArray = new Uint8Array(anArrayBuffer);
|
||||
describe('stringToArrayBuffer', () => {
|
||||
it('returns ArrayBuffer when passed string', () => {
|
||||
const StaticArrayBufferProto = new ArrayBuffer().__proto__;
|
||||
const anArrayBuffer = new ArrayBuffer(1);
|
||||
const typedArray = new Uint8Array(anArrayBuffer);
|
||||
typedArray[0] = 'a'.charCodeAt(0);
|
||||
assertEqualArrayBuffers(stringToArrayBuffer('a'), anArrayBuffer);
|
||||
});
|
||||
it('throws an error when passed a non string', function() {
|
||||
var notStringable = [{}, undefined, null, new ArrayBuffer()];
|
||||
notStringable.forEach(function(notString) {
|
||||
assert.throw(function() {
|
||||
it('throws an error when passed a non string', () => {
|
||||
const notStringable = [{}, undefined, null, new ArrayBuffer()];
|
||||
notStringable.forEach(notString => {
|
||||
assert.throw(() => {
|
||||
stringToArrayBuffer(notString);
|
||||
}, Error);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user