move unit tests to sub folder

pull/1287/head
Audric Ackermann 5 years ago
parent c12c3b5f64
commit 80b0821781
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -31,9 +31,9 @@
"test-lib-view": "NODE_ENV=test-lib yarn run start",
"test-loki-view": "NODE_ENV=test-loki yarn run start",
"test-electron": "yarn grunt test",
"test-integration": "ELECTRON_DISABLE_SANDBOX=1 mocha --exit --timeout 10000 ts/test/session/integration/integration_test.js",
"test-integration": "ELECTRON_DISABLE_SANDBOX=1 mocha --exit --full-trace --timeout 10000 ts/test/session/integration/integration_test.js",
"test-node": "mocha --recursive --exit test/app test/modules ts/test libloki/test/node --timeout 10000",
"test-session": "mocha --recursive --exit ts/test/session --timeout 10000",
"test-session": "mocha --recursive --exit ts/test/session/unit --full-trace --timeout 10000",
"test-medium-groups": "ELECTRON_DISABLE_SANDBOX=1 mocha --exit --timeout 10000 integration_test/integration_test.js --grep 'senderkeys'",
"test-groups": "ELECTRON_DISABLE_SANDBOX=1 mocha --exit --timeout 10000 integration_test/integration_test.js --grep 'Closed groups'",
"eslint": "eslint --cache .",

@ -1,13 +1,13 @@
import { expect } from 'chai';
import * as crypto from 'crypto';
import * as sinon from 'sinon';
import { MessageEncrypter } from '../../../session/crypto';
import { EncryptionType } from '../../../session/types/EncryptionType';
import { Stubs, TestUtils } from '../../test-utils';
import { UserUtil } from '../../../util';
import { SignalService } from '../../../protobuf';
import { MessageEncrypter } from '../../../../session/crypto';
import { EncryptionType } from '../../../../session/types/EncryptionType';
import { Stubs, TestUtils } from '../../../test-utils';
import { UserUtil } from '../../../../util';
import { SignalService } from '../../../../protobuf';
import * as Ratchet from '../../../session/medium_group/ratchet';
import * as Ratchet from '../../../../session/medium_group/ratchet';
// tslint:disable-next-line: max-func-body-length
describe('MessageEncrypter', () => {

@ -5,11 +5,11 @@ import {
ChatMessage,
Preview,
Quote,
} from '../../../session/messages/outgoing';
import { SignalService } from '../../../protobuf';
} from '../../../../session/messages/outgoing';
import { SignalService } from '../../../../protobuf';
import { TextEncoder } from 'util';
import { toNumber } from 'lodash';
import { Constants } from '../../../session';
import { Constants } from '../../../../session';
describe('ChatMessage', () => {
it('can create empty message with just a timestamp', () => {

@ -3,13 +3,13 @@ import { expect } from 'chai';
import {
ChatMessage,
ClosedGroupChatMessage,
} from '../../../session/messages/outgoing';
import { SignalService } from '../../../protobuf';
} from '../../../../session/messages/outgoing';
import { SignalService } from '../../../../protobuf';
import { TextEncoder } from 'util';
import { TestUtils } from '../../test-utils';
import { StringUtils } from '../../../session/utils';
import { PubKey } from '../../../session/types';
import { Constants } from '../../../session';
import { TestUtils } from '../../../test-utils';
import { StringUtils } from '../../../../session/utils';
import { PubKey } from '../../../../session/types';
import { Constants } from '../../../../session';
describe('ClosedGroupChatMessage', () => {
let groupId: PubKey;

@ -4,10 +4,10 @@ import { beforeEach } from 'mocha';
import {
DeviceLinkGrantMessage,
DeviceLinkRequestMessage,
} from '../../../session/messages/outgoing';
import { SignalService } from '../../../protobuf';
import { LokiProfile } from '../../../types/Message';
import { Constants } from '../../../session';
} from '../../../../session/messages/outgoing';
import { SignalService } from '../../../../protobuf';
import { LokiProfile } from '../../../../types/Message';
import { Constants } from '../../../../session';
describe('DeviceLinkMessage', () => {
let linkRequestMessage: DeviceLinkRequestMessage;

@ -1,9 +1,9 @@
import { expect } from 'chai';
import { beforeEach } from 'mocha';
import { DeviceUnlinkMessage } from '../../../session/messages/outgoing';
import { SignalService } from '../../../protobuf';
import { Constants } from '../../../session';
import { DeviceUnlinkMessage } from '../../../../session/messages/outgoing';
import { SignalService } from '../../../../protobuf';
import { Constants } from '../../../../session';
describe('DeviceUnlinkMessage', () => {
let message: DeviceUnlinkMessage;

@ -1,10 +1,10 @@
import { expect } from 'chai';
import { beforeEach } from 'mocha';
import { EndSessionMessage } from '../../../session/messages/outgoing';
import { SignalService } from '../../../protobuf';
import { EndSessionMessage } from '../../../../session/messages/outgoing';
import { SignalService } from '../../../../protobuf';
import { TextEncoder } from 'util';
import { Constants } from '../../../session';
import { Constants } from '../../../../session';
describe('EndSessionMessage', () => {
let message: EndSessionMessage;

@ -1,9 +1,9 @@
import { expect } from 'chai';
import { beforeEach } from 'mocha';
import { GroupInvitationMessage } from '../../../session/messages/outgoing';
import { SignalService } from '../../../protobuf';
import { Constants } from '../../../session';
import { GroupInvitationMessage } from '../../../../session/messages/outgoing';
import { SignalService } from '../../../../protobuf';
import { Constants } from '../../../../session';
describe('GroupInvitationMessage', () => {
let message: GroupInvitationMessage;

@ -3,9 +3,9 @@ import { expect } from 'chai';
import {
AttachmentPointer,
OpenGroupMessage,
} from '../../../session/messages/outgoing';
import * as MIME from '../../../../ts/types/MIME';
import { OpenGroup } from '../../../session/types';
} from '../../../../session/messages/outgoing';
import * as MIME from '../../../../../ts/types/MIME';
import { OpenGroup } from '../../../../session/types';
describe('OpenGroupMessage', () => {
const group = new OpenGroup({

@ -4,10 +4,10 @@ import { beforeEach } from 'mocha';
import {
DeliveryReceiptMessage,
ReadReceiptMessage,
} from '../../../session/messages/outgoing';
import { SignalService } from '../../../protobuf';
} from '../../../../session/messages/outgoing';
import { SignalService } from '../../../../protobuf';
import { toNumber } from 'lodash';
import { Constants } from '../../../session';
import { Constants } from '../../../../session';
describe('ReceiptMessage', () => {
let readMessage: ReadReceiptMessage;

@ -1,9 +1,9 @@
import { expect } from 'chai';
import { beforeEach } from 'mocha';
import { SessionEstablishedMessage } from '../../../session/messages/outgoing';
import { SignalService } from '../../../protobuf';
import { Constants } from '../../../session';
import { SessionEstablishedMessage } from '../../../../session/messages/outgoing';
import { SignalService } from '../../../../protobuf';
import { Constants } from '../../../../session';
describe('SessionEstablishedMessage', () => {
let message: SessionEstablishedMessage;

@ -1,10 +1,10 @@
import { expect } from 'chai';
import { beforeEach } from 'mocha';
import { SessionRequestMessage } from '../../../session/messages/outgoing';
import { SignalService } from '../../../protobuf';
import { SessionRequestMessage } from '../../../../session/messages/outgoing';
import { SignalService } from '../../../../protobuf';
import { TextDecoder, TextEncoder } from 'util';
import { Constants } from '../../../session';
import { Constants } from '../../../../session';
describe('SessionRequestMessage', () => {
let message: SessionRequestMessage;

@ -1,13 +1,12 @@
import { expect } from 'chai';
import { TypingMessage } from '../../../session/messages/outgoing';
import { SignalService } from '../../../protobuf';
import { TextEncoder } from 'util';
import { TypingMessage } from '../../../../session/messages/outgoing';
import { SignalService } from '../../../../protobuf';
import Long from 'long';
import { toNumber } from 'lodash';
import { StringUtils } from '../../../session/utils';
import { TestUtils } from '../../test-utils';
import { Constants } from '../../../session';
import { StringUtils } from '../../../../session/utils';
import { TestUtils } from '../../../test-utils';
import { Constants } from '../../../../session';
describe('TypingMessage', () => {
it('has Action.STARTED if isTyping = true', () => {

@ -1,11 +1,11 @@
import { expect } from 'chai';
import * as sinon from 'sinon';
import { TestUtils } from '../../test-utils';
import { PairingAuthorisation } from '../../../../js/modules/data';
import { MultiDeviceProtocol } from '../../../session/protocols';
import { PubKey } from '../../../session/types';
import { UserUtil } from '../../../util';
import { StringUtils } from '../../../session/utils';
import { TestUtils } from '../../../test-utils';
import { PairingAuthorisation } from '../../../../../js/modules/data';
import { MultiDeviceProtocol } from '../../../../session/protocols';
import { PubKey } from '../../../../session/types';
import { UserUtil } from '../../../../util';
import { StringUtils } from '../../../../session/utils';
function generateFakeAuthorisations(
primary: PubKey,

@ -1,12 +1,12 @@
import { expect } from 'chai';
import { SessionProtocol } from '../../../session/protocols';
import * as sinon from 'sinon';
import { Stubs, TestUtils } from '../../test-utils';
import { UserUtil } from '../../../util';
import { SessionRequestMessage } from '../../../session/messages/outgoing';
import { SessionProtocol } from '../../../../session/protocols';
import { Stubs, TestUtils } from '../../../test-utils';
import { UserUtil } from '../../../../util';
import { SessionRequestMessage } from '../../../../session/messages/outgoing';
import { TextEncoder } from 'util';
import { MessageSender } from '../../../session/sending';
import { PubKey } from '../../../session/types';
import { MessageSender } from '../../../../session/sending';
import { PubKey } from '../../../../session/types';
// tslint:disable-next-line: max-func-body-length
describe('SessionProtocol', () => {

@ -1,24 +1,25 @@
import chai from 'chai';
import * as sinon from 'sinon';
import _ from 'lodash';
import { GroupUtils, PromiseUtils } from '../../../session/utils';
import { Stubs, TestUtils } from '../../../test/test-utils';
import { MessageQueue } from '../../../session/sending/MessageQueue';
import { describe } from 'mocha';
import { GroupUtils, PromiseUtils } from '../../../../session/utils';
import { Stubs, TestUtils } from '../../../../test/test-utils';
import { MessageQueue } from '../../../../session/sending/MessageQueue';
import {
ClosedGroupMessage,
ContentMessage,
OpenGroupMessage,
} from '../../../session/messages/outgoing';
import { PrimaryPubKey, PubKey, RawMessage } from '../../../session/types';
import { UserUtil } from '../../../util';
import { MessageSender } from '../../../session/sending';
} from '../../../../session/messages/outgoing';
import { PrimaryPubKey, PubKey, RawMessage } from '../../../../session/types';
import { UserUtil } from '../../../../util';
import { MessageSender } from '../../../../session/sending';
import {
MultiDeviceProtocol,
SessionProtocol,
} from '../../../session/protocols';
import { PendingMessageCacheStub } from '../../test-utils/stubs';
import { describe } from 'mocha';
import { TestSyncMessage } from '../../test-utils/stubs/messages/TestSyncMessage';
} from '../../../../session/protocols';
import { PendingMessageCacheStub } from '../../../test-utils/stubs';
import { TestSyncMessage } from '../../../test-utils/stubs/messages/TestSyncMessage';
// tslint:disable-next-line: no-require-imports no-var-requires
const chaiAsPromised = require('chai-as-promised');

@ -2,15 +2,15 @@ import { expect } from 'chai';
import * as crypto from 'crypto';
import * as sinon from 'sinon';
import { toNumber } from 'lodash';
import { MessageSender } from '../../../session/sending';
import LokiMessageAPI from '../../../../js/modules/loki_message_api';
import { TestUtils } from '../../test-utils';
import { UserUtil } from '../../../util';
import { MessageEncrypter } from '../../../session/crypto';
import { SignalService } from '../../../protobuf';
import { OpenGroupMessage } from '../../../session/messages/outgoing';
import { EncryptionType } from '../../../session/types/EncryptionType';
import { PubKey } from '../../../session/types';
import { MessageSender } from '../../../../session/sending';
import LokiMessageAPI from '../../../../../js/modules/loki_message_api';
import { TestUtils } from '../../../test-utils';
import { UserUtil } from '../../../../util';
import { MessageEncrypter } from '../../../../session/crypto';
import { SignalService } from '../../../../protobuf';
import { OpenGroupMessage } from '../../../../session/messages/outgoing';
import { EncryptionType } from '../../../../session/types/EncryptionType';
import { PubKey } from '../../../../session/types';
describe('MessageSender', () => {
const sandbox = sinon.createSandbox();

@ -1,10 +1,10 @@
import { expect } from 'chai';
import * as sinon from 'sinon';
import * as _ from 'lodash';
import { MessageUtils } from '../../../session/utils';
import { TestUtils } from '../../../test/test-utils';
import { PendingMessageCache } from '../../../session/sending/PendingMessageCache';
import { SessionProtocol } from '../../../session/protocols';
import { MessageUtils } from '../../../../session/utils';
import { TestUtils } from '../../../../test/test-utils';
import { PendingMessageCache } from '../../../../session/sending/PendingMessageCache';
import { SessionProtocol } from '../../../../session/protocols';
// Equivalent to Data.StorageItem
interface StorageItem {

@ -1,7 +1,7 @@
import chai from 'chai';
import { v4 as uuid } from 'uuid';
import { JobQueue } from '../../../session/utils/JobQueue';
import { TestUtils } from '../../test-utils';
import { JobQueue } from '../../../../session/utils/JobQueue';
import { TestUtils } from '../../../test-utils';
// tslint:disable-next-line: no-require-imports no-var-requires
const chaiAsPromised = require('chai-as-promised');

@ -1,14 +1,14 @@
import chai from 'chai';
import * as sinon from 'sinon';
import crypto from 'crypto';
import { TestUtils } from '../../test-utils/';
import { MessageUtils } from '../../../session/utils/';
import { EncryptionType, PubKey } from '../../../session/types/';
import { SessionProtocol } from '../../../session/protocols';
import { TestUtils } from '../../../test-utils';
import { MessageUtils } from '../../../../session/utils';
import { EncryptionType, PubKey } from '../../../../session/types';
import { SessionProtocol } from '../../../../session/protocols';
import {
MediumGroupChatMessage,
SessionRequestMessage,
} from '../../../session/messages/outgoing';
} from '../../../../session/messages/outgoing';
// tslint:disable-next-line: no-require-imports no-var-requires
const chaiAsPromised = require('chai-as-promised');

@ -1,7 +1,7 @@
import chai from 'chai';
import * as sinon from 'sinon';
import { PromiseUtils } from '../../../session/utils/';
import { PromiseUtils } from '../../../../session/utils';
// tslint:disable-next-line: no-require-imports no-var-requires
const chaiAsPromised = require('chai-as-promised');

@ -2,8 +2,8 @@ import chai from 'chai';
import ByteBuffer from 'bytebuffer';
// Can't import type as StringUtils.Encoding
import { Encoding } from '../../../session/utils/String';
import { StringUtils } from '../../../session/utils/';
import { Encoding } from '../../../../session/utils/String';
import { StringUtils } from '../../../../session/utils';
// tslint:disable-next-line: no-require-imports no-var-requires
const chaiAsPromised = require('chai-as-promised');

@ -1,11 +1,11 @@
import chai from 'chai';
import * as sinon from 'sinon';
import { SyncMessageUtils } from '../../../session/utils/';
import { TestUtils } from '../../test-utils';
import { UserUtil } from '../../../util';
import { MultiDeviceProtocol } from '../../../session/protocols';
import { SyncMessage } from '../../../session/messages/outgoing';
import { SyncMessageUtils } from '../../../../session/utils';
import { TestUtils } from '../../../test-utils';
import { UserUtil } from '../../../../util';
import { MultiDeviceProtocol } from '../../../../session/protocols';
import { SyncMessage } from '../../../../session/messages/outgoing';
// tslint:disable-next-line: no-require-imports no-var-requires
const chaiAsPromised = require('chai-as-promised');
Loading…
Cancel
Save