Move tests to their own folder
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { describe, it, expect } from 'vitest';
|
import { describe, it, expect } from 'vitest';
|
||||||
import { PublicKey, PrivateKey, SharedSecret, StaticSecret } from './crypto';
|
import { PublicKey, PrivateKey, SharedSecret, StaticSecret } from '../src/crypto';
|
||||||
import { bytesToHex, hexToBytes } from './parser';
|
import { bytesToHex, hexToBytes } from '../src/parser';
|
||||||
|
|
||||||
const randomBytes = (len: number) => Uint8Array.from({ length: len }, () => Math.floor(Math.random() * 256));
|
const randomBytes = (len: number) => Uint8Array.from({ length: len }, () => Math.floor(Math.random() * 256));
|
||||||
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import { describe, it, expect, beforeEach } from 'vitest';
|
import { describe, it, expect, beforeEach } from 'vitest';
|
||||||
import { Identity, LocalIdentity, Contact, Group, Contacts, parseNodeHash } from './identity';
|
import { Identity, LocalIdentity, Contact, Group, Contacts, parseNodeHash } from '../src/identity';
|
||||||
import { PrivateKey, PublicKey, SharedSecret } from './crypto';
|
import { PrivateKey, PublicKey, SharedSecret } from '../src/crypto';
|
||||||
import { DecryptedGroupText, DecryptedGroupData } from './packet.types';
|
import { DecryptedGroupText, DecryptedGroupData } from '../src/packet.types';
|
||||||
import { bytesToHex } from './parser';
|
import { bytesToHex } from '../src/parser';
|
||||||
|
|
||||||
function randomBytes(len: number) {
|
function randomBytes(len: number) {
|
||||||
return Uint8Array.from({ length: len }, () => Math.floor(Math.random() * 256));
|
return Uint8Array.from({ length: len }, () => Math.floor(Math.random() * 256));
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { describe, expect, test } from 'vitest';
|
import { describe, expect, test } from 'vitest';
|
||||||
import { Packet } from './packet';
|
import { Packet } from '../src/packet';
|
||||||
import { PayloadType, RouteType, NodeType, TracePayload, AdvertPayload, RequestPayload, TextPayload, ResponsePayload, RawCustomPayload, AnonReqPayload } from './packet.types';
|
import { PayloadType, RouteType, NodeType, TracePayload, AdvertPayload, RequestPayload, TextPayload, ResponsePayload, RawCustomPayload, AnonReqPayload } from '../src/packet.types';
|
||||||
import { hexToBytes, bytesToHex } from './parser';
|
import { hexToBytes, bytesToHex } from '../src/parser';
|
||||||
|
|
||||||
describe('Packet.fromBytes', () => {
|
describe('Packet.fromBytes', () => {
|
||||||
test('frame 1: len=122 type=5 payload_len=99', () => {
|
test('frame 1: len=122 type=5 payload_len=99', () => {
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, it, expect } from 'vitest';
|
import { describe, it, expect } from 'vitest';
|
||||||
import { base64ToBytes, hexToBytes, BufferReader, BufferWriter } from './parser';
|
import { base64ToBytes, hexToBytes, BufferReader, BufferWriter } from '../src/parser';
|
||||||
|
|
||||||
describe('base64ToBytes', () => {
|
describe('base64ToBytes', () => {
|
||||||
it('decodes a simple base64 string', () => {
|
it('decodes a simple base64 string', () => {
|
||||||
Reference in New Issue
Block a user