diff --git a/.eslintrc b/.eslintrc index c7660c2..1b7d3bd 100644 --- a/.eslintrc +++ b/.eslintrc @@ -7,8 +7,8 @@ }, "project": [ "./tsconfig.json", - "./test/tsconfig.json", - "./integration/tsconfig.json" + "./test/unit/tsconfig.json", + "./test/integration/tsconfig.json" ] }, "extends": [ diff --git a/.travis.yml b/.travis.yml index 0671b46..33a8834 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,7 @@ script: - export ETH_PORT=18545; npm run test:cover - npm run build - npm run doc - - npm run integration:cover + - npm run test:integration:cover after_script: - npm run report-codacy diff --git a/README.md b/README.md index ccb053e..318f938 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,7 @@ npm run test:cover ### Integration Tests -Besides a running `ganache-cli` instance, a locally running Ocean network is required. To do so before running the tests, use [Barge](https://github.com/oceanprotocol/barge): +A locally running Ocean network is required. To do so before running the tests, use [Barge](https://github.com/oceanprotocol/barge): ```bash git clone https://github.com/oceanprotocol/barge @@ -176,13 +176,13 @@ Once everything is up, run the integration tests: ```bash # integration tests work with the spree network and the SEED_WORDS in previous step are required. # Make sure to reset `ETH_PORT` to 8545 (or whatever port is used in `spree1) -npm run integration +npm run test:integration ``` to generate code coverage information during test, run: ```bash -npm run integration:cover +npm run test:integration:cover ``` ## Code Style diff --git a/package.json b/package.json index 937bf35..cf4b393 100644 --- a/package.json +++ b/package.json @@ -12,15 +12,15 @@ "build:metadata": "./scripts/get-metadata.js > src/metadata.json", "build:dist": "cross-env NODE_ENV=production webpack", "build:watch": "tsc -w", - "test": "mocha", - "test:watch": "mocha -w --watch-extensions js,ts,json", - "test:cover": "nyc --report-dir coverage/unit mocha", - "integration": "mocha --opts integration/mocha.opts", - "integration:pacific": "export NETWORK_NAME=pacific; mocha --opts integration/mocha.opts", - "integration:nile": "export NETWORK_NAME=nile; mocha --opts integration/mocha.opts", - "integration:duero": "export NETWORK_NAME=duero; mocha --opts integration/mocha.opts", - "integration:watch": "mocha -w --watch-extensions js,ts,json --opts integration/mocha.opts", - "integration:cover": "nyc --report-dir coverage/integration mocha --opts integration/mocha.opts", + "test": "mocha --opts test/unit/mocha.opts", + "test:watch": "npm test -- -w --watch-extensions js,ts,json", + "test:cover": "nyc --report-dir coverage/unit npm test", + "test:integration": "mocha --opts test/integration/mocha.opts", + "test:integration:pacific": "export NETWORK_NAME=pacific; npm run test:integration", + "test:integration:nile": "export NETWORK_NAME=nile; npm run test:integration", + "test:integration:duero": "export NETWORK_NAME=duero; npm run test:integration", + "test:integration:watch": "npm run test:integration -- -w --watch-extensions js,ts,json", + "test:integration:cover": "nyc --report-dir coverage/integration npm run test:integration", "clean": "rm -rf ./dist/ ./doc/ ./.nyc_output", "lint": "eslint --ignore-path .gitignore --ext .ts,.tsx .", "format": "prettier --parser typescript --ignore-path .gitignore --write '**/*.{js,jsx,ts,tsx}'", @@ -105,7 +105,7 @@ "ts-node/register" ], "reporter": [ - "text-summary", + "text", "lcov", "html" ], diff --git a/integration/config.ts b/test/integration/config.ts similarity index 98% rename from integration/config.ts rename to test/integration/config.ts index 3d2bd3d..539797f 100644 --- a/integration/config.ts +++ b/test/integration/config.ts @@ -1,4 +1,4 @@ -import { Config } from '../src' +import { Config } from '../../src' import HDWalletProvider from '@truffle/hdwallet-provider' const configJson: Config = { diff --git a/integration/mocha.opts b/test/integration/mocha.opts similarity index 81% rename from integration/mocha.opts rename to test/integration/mocha.opts index 7c3437b..b192173 100644 --- a/integration/mocha.opts +++ b/test/integration/mocha.opts @@ -4,4 +4,4 @@ --full-trace --exit --timeout 300000 -integration/**/*.test.ts +test/integration/**/*.test.ts diff --git a/integration/ocean/AssetOwners.test.ts b/test/integration/ocean/AssetOwners.test.ts similarity index 97% rename from integration/ocean/AssetOwners.test.ts rename to test/integration/ocean/AssetOwners.test.ts index 5133513..798971c 100644 --- a/integration/ocean/AssetOwners.test.ts +++ b/test/integration/ocean/AssetOwners.test.ts @@ -1,7 +1,7 @@ import { assert } from 'chai' import { config } from '../config' import { getMetadata } from '../utils' -import { Ocean, Account } from '../../src' // @oceanprotocol/squid +import { Ocean, Account } from '../../../src' // @oceanprotocol/squid describe('Asset Owners', () => { let ocean: Ocean diff --git a/integration/ocean/AuthenticationToken.test.ts b/test/integration/ocean/AuthenticationToken.test.ts similarity index 96% rename from integration/ocean/AuthenticationToken.test.ts rename to test/integration/ocean/AuthenticationToken.test.ts index 9c0f601..9ff07f6 100644 --- a/integration/ocean/AuthenticationToken.test.ts +++ b/test/integration/ocean/AuthenticationToken.test.ts @@ -1,6 +1,6 @@ import { assert } from 'chai' import { config } from '../config' -import { Ocean, Account } from '../../src' // @oceanprotocol/squid +import { Ocean, Account } from '../../../src' // @oceanprotocol/squid describe('Authentication Token', () => { let ocean: Ocean diff --git a/integration/ocean/ConsumeAsset.test.ts b/test/integration/ocean/ConsumeAsset.test.ts similarity index 98% rename from integration/ocean/ConsumeAsset.test.ts rename to test/integration/ocean/ConsumeAsset.test.ts index 9e4c679..67a2658 100644 --- a/integration/ocean/ConsumeAsset.test.ts +++ b/test/integration/ocean/ConsumeAsset.test.ts @@ -4,7 +4,7 @@ import * as fs from 'fs' import { config } from '../config' import { getMetadata } from '../utils' -import { Ocean, DDO, Account, ConditionState } from '../../src' // @oceanprotocol/squid +import { Ocean, DDO, Account, ConditionState } from '../../../src' // @oceanprotocol/squid describe('Consume Asset', () => { let ocean: Ocean diff --git a/integration/ocean/ConsumeAssetBrizo.test.ts b/test/integration/ocean/ConsumeAssetBrizo.test.ts similarity index 96% rename from integration/ocean/ConsumeAssetBrizo.test.ts rename to test/integration/ocean/ConsumeAssetBrizo.test.ts index 53c5924..722ed95 100644 --- a/integration/ocean/ConsumeAssetBrizo.test.ts +++ b/test/integration/ocean/ConsumeAssetBrizo.test.ts @@ -4,7 +4,7 @@ import * as fs from 'fs' import { config } from '../config' import { getMetadata } from '../utils' -import { Ocean, Account, DDO } from '../../src' // @oceanprotocol/squid +import { Ocean, Account, DDO } from '../../../src' // @oceanprotocol/squid describe('Consume Asset (Brizo)', () => { let ocean: Ocean diff --git a/integration/ocean/ConsumeBigAsset.test.ts b/test/integration/ocean/ConsumeBigAsset.test.ts similarity index 96% rename from integration/ocean/ConsumeBigAsset.test.ts rename to test/integration/ocean/ConsumeBigAsset.test.ts index b1d1f22..a5d135e 100644 --- a/integration/ocean/ConsumeBigAsset.test.ts +++ b/test/integration/ocean/ConsumeBigAsset.test.ts @@ -4,7 +4,7 @@ import * as fs from 'fs' import { config } from '../config' import { getMetadata } from '../utils' -import { Ocean, Account, DDO } from '../../src' // @oceanprotocol/squid +import { Ocean, Account, DDO } from '../../../src' // @oceanprotocol/squid // Ensure that your network is fast enought and you have some free ram before run it. xdescribe('Consume Asset (Large size)', () => { diff --git a/integration/ocean/RegisterEscrowAccessSecretStoreTemplate.test.ts b/test/integration/ocean/RegisterEscrowAccessSecretStoreTemplate.test.ts similarity index 99% rename from integration/ocean/RegisterEscrowAccessSecretStoreTemplate.test.ts rename to test/integration/ocean/RegisterEscrowAccessSecretStoreTemplate.test.ts index acb56f4..53ea58b 100644 --- a/integration/ocean/RegisterEscrowAccessSecretStoreTemplate.test.ts +++ b/test/integration/ocean/RegisterEscrowAccessSecretStoreTemplate.test.ts @@ -2,7 +2,7 @@ import { assert } from 'chai' import { config } from '../config' -import { Ocean, templates, conditions, utils, Account, Keeper } from '../../src' // @oceanprotocol/squid +import { Ocean, templates, conditions, utils, Account, Keeper } from '../../../src' // @oceanprotocol/squid const { LockRewardCondition, EscrowReward, AccessSecretStoreCondition } = conditions diff --git a/integration/ocean/RegisterEscrowComputeExecutionTemplate.test.ts b/test/integration/ocean/RegisterEscrowComputeExecutionTemplate.test.ts similarity index 99% rename from integration/ocean/RegisterEscrowComputeExecutionTemplate.test.ts rename to test/integration/ocean/RegisterEscrowComputeExecutionTemplate.test.ts index 7f476fa..735f1de 100644 --- a/integration/ocean/RegisterEscrowComputeExecutionTemplate.test.ts +++ b/test/integration/ocean/RegisterEscrowComputeExecutionTemplate.test.ts @@ -2,7 +2,7 @@ import { assert } from 'chai' import { config } from '../config' -import { Ocean, templates, conditions, utils, Account, Keeper } from '../../src' // @oceanprotocol/squid +import { Ocean, templates, conditions, utils, Account, Keeper } from '../../../src' // @oceanprotocol/squid const { LockRewardCondition, EscrowReward, ComputeExecutionCondition } = conditions diff --git a/integration/ocean/SearchAsset.test.ts b/test/integration/ocean/SearchAsset.test.ts similarity index 97% rename from integration/ocean/SearchAsset.test.ts rename to test/integration/ocean/SearchAsset.test.ts index ec6b8b9..7e8ba4d 100644 --- a/integration/ocean/SearchAsset.test.ts +++ b/test/integration/ocean/SearchAsset.test.ts @@ -4,7 +4,7 @@ import { config } from '../config' import { generateMetadata } from '../utils' -import { Ocean, Account, DDO } from '../../src' // @oceanprotocol/squid +import { Ocean, Account, DDO } from '../../../src' // @oceanprotocol/squid describe('Search Asset', () => { let ocean: Ocean diff --git a/integration/ocean/SecretStore.test.ts b/test/integration/ocean/SecretStore.test.ts similarity index 89% rename from integration/ocean/SecretStore.test.ts rename to test/integration/ocean/SecretStore.test.ts index 91e578b..3b9f2a9 100644 --- a/integration/ocean/SecretStore.test.ts +++ b/test/integration/ocean/SecretStore.test.ts @@ -2,7 +2,7 @@ import { assert } from 'chai' import { config } from '../config' -import { Ocean, Account, DID } from '../../src' // @oceanprotocol/squid +import { Ocean, Account, DID } from '../../../src' // @oceanprotocol/squid describe('Secret Store', () => { let ocean: Ocean diff --git a/integration/ocean/Signature.test.ts b/test/integration/ocean/Signature.test.ts similarity index 97% rename from integration/ocean/Signature.test.ts rename to test/integration/ocean/Signature.test.ts index 44828f9..71a959c 100644 --- a/integration/ocean/Signature.test.ts +++ b/test/integration/ocean/Signature.test.ts @@ -2,7 +2,7 @@ import { assert } from 'chai' import { config } from '../config' -import { Ocean, Account, DDO } from '../../src' // @oceanprotocol/squid +import { Ocean, Account, DDO } from '../../../src' // @oceanprotocol/squid // WARN: not integration test. It has been done here because constant values // depends on the first account on spree (only accessible from integration test) diff --git a/integration/ocean/Versions.test.ts b/test/integration/ocean/Versions.test.ts similarity index 89% rename from integration/ocean/Versions.test.ts rename to test/integration/ocean/Versions.test.ts index 8b64c32..19ce70f 100644 --- a/integration/ocean/Versions.test.ts +++ b/test/integration/ocean/Versions.test.ts @@ -2,7 +2,7 @@ import { assert } from 'chai' import { config } from '../config' -import { Ocean, OceanPlatformTechStatus } from '../../src' // @oceanprotocol/squid +import { Ocean, OceanPlatformTechStatus } from '../../../src' // @oceanprotocol/squid describe('Versions', () => { let ocean: Ocean diff --git a/integration/tsconfig.json b/test/integration/tsconfig.json similarity index 100% rename from integration/tsconfig.json rename to test/integration/tsconfig.json diff --git a/integration/utils/ddo-metadata-generator.ts b/test/integration/utils/ddo-metadata-generator.ts similarity index 96% rename from integration/utils/ddo-metadata-generator.ts rename to test/integration/utils/ddo-metadata-generator.ts index 8608aad..ed488e4 100644 --- a/integration/utils/ddo-metadata-generator.ts +++ b/test/integration/utils/ddo-metadata-generator.ts @@ -1,4 +1,4 @@ -import { MetaData } from '../../src' // @oceanprotocol/squid +import { MetaData } from '../../../src' // @oceanprotocol/squid const metadata: Partial = { main: { diff --git a/integration/utils/index.ts b/test/integration/utils/index.ts similarity index 100% rename from integration/utils/index.ts rename to test/integration/utils/index.ts diff --git a/test/Squid.test.ts b/test/unit/Squid.test.ts similarity index 82% rename from test/Squid.test.ts rename to test/unit/Squid.test.ts index b82ee4d..517e9aa 100644 --- a/test/Squid.test.ts +++ b/test/unit/Squid.test.ts @@ -1,5 +1,5 @@ import assert from 'assert' -import * as squid from '../src/squid' +import * as squid from '../../src/squid' describe('Squid', () => { describe('interface', () => { diff --git a/test/TestIdGenerator.ts b/test/unit/TestIdGenerator.ts similarity index 66% rename from test/TestIdGenerator.ts rename to test/unit/TestIdGenerator.ts index d6b85ad..a0b2a76 100644 --- a/test/TestIdGenerator.ts +++ b/test/unit/TestIdGenerator.ts @@ -1,4 +1,4 @@ -import { generateId } from '../src/utils/GeneratorHelpers' +import { generateId } from '../../src/utils/GeneratorHelpers' export default class TestIdGenerator { public static generatePrefixedId() { diff --git a/test/aquarius/Aquarius.test.ts b/test/unit/aquarius/Aquarius.test.ts similarity index 94% rename from test/aquarius/Aquarius.test.ts rename to test/unit/aquarius/Aquarius.test.ts index 0927779..e9ff8f9 100644 --- a/test/aquarius/Aquarius.test.ts +++ b/test/unit/aquarius/Aquarius.test.ts @@ -1,11 +1,11 @@ import { assert, spy, use } from 'chai' import spies from 'chai-spies' -import { Ocean } from '../../src/ocean/Ocean' -import { Aquarius, SearchQuery } from '../../src/aquarius/Aquarius' -import { DDO } from '../../src/ddo/DDO' -import DID from '../../src/ocean/DID' +import { Ocean } from '../../../src/ocean/Ocean' +import { Aquarius, SearchQuery } from '../../../src/aquarius/Aquarius' +import { DDO } from '../../../src/ddo/DDO' +import DID from '../../../src/ocean/DID' import config from '../config' -import { LoggerInstance } from '../../src/utils' +import { LoggerInstance } from '../../../src/utils' use(spies) diff --git a/test/config.ts b/test/unit/config.ts similarity index 75% rename from test/config.ts rename to test/unit/config.ts index 1954f33..aaf62df 100644 --- a/test/config.ts +++ b/test/unit/config.ts @@ -1,5 +1,5 @@ -import { Config, LogLevel } from '../src/models/Config' -import { LoggerInstance } from '../src/utils' +import { Config, LogLevel } from '../../src/models/Config' +import { LoggerInstance } from '../../src/utils' LoggerInstance.setLevel(LogLevel.Error) diff --git a/test/ddo/DDO.test.ts b/test/unit/ddo/DDO.test.ts similarity index 98% rename from test/ddo/DDO.test.ts rename to test/unit/ddo/DDO.test.ts index 3747834..1c65d14 100644 --- a/test/ddo/DDO.test.ts +++ b/test/unit/ddo/DDO.test.ts @@ -1,9 +1,9 @@ import { assert, expect, spy, use } from 'chai' import spies from 'chai-spies' -import { DDO } from '../../src/ddo/DDO' -import { Service } from '../../src/ddo/Service' -import { Ocean } from '../../src/ocean/Ocean' +import { DDO } from '../../../src/ddo/DDO' +import { Service } from '../../../src/ddo/Service' +import { Ocean } from '../../../src/ocean/Ocean' import config from '../config' import TestContractHandler from '../keeper/TestContractHandler' diff --git a/test/keeper/ContractBase.test.ts b/test/unit/keeper/ContractBase.test.ts similarity index 95% rename from test/keeper/ContractBase.test.ts rename to test/unit/keeper/ContractBase.test.ts index 53bc69b..2e0d20f 100644 --- a/test/keeper/ContractBase.test.ts +++ b/test/unit/keeper/ContractBase.test.ts @@ -1,6 +1,6 @@ import { assert } from 'chai' -import Account from '../../src/ocean/Account' -import { Ocean } from '../../src/ocean/Ocean' +import Account from '../../../src/ocean/Account' +import { Ocean } from '../../../src/ocean/Ocean' import config from '../config' import ContractBaseMock from '../mocks/ContractBase.Mock' import TestContractHandler from './TestContractHandler' diff --git a/test/keeper/ContractEvent.test.ts b/test/unit/keeper/ContractEvent.test.ts similarity index 93% rename from test/keeper/ContractEvent.test.ts rename to test/unit/keeper/ContractEvent.test.ts index db0999b..6529dd0 100644 --- a/test/keeper/ContractEvent.test.ts +++ b/test/unit/keeper/ContractEvent.test.ts @@ -1,7 +1,7 @@ import { assert } from 'chai' -import { EventHandler } from '../../src/keeper/EventHandler' -import { ContractEventSubscription } from '../../src/keeper/ContractEvent' -import { Ocean } from '../../src/ocean/Ocean' +import { EventHandler } from '../../../src/keeper/EventHandler' +import { ContractEventSubscription } from '../../../src/keeper/ContractEvent' +import { Ocean } from '../../../src/ocean/Ocean' import config from '../config' import TestContractHandler from './TestContractHandler' diff --git a/test/keeper/ContractHandler.test.ts b/test/unit/keeper/ContractHandler.test.ts similarity index 85% rename from test/keeper/ContractHandler.test.ts rename to test/unit/keeper/ContractHandler.test.ts index 7564fa2..754211e 100644 --- a/test/keeper/ContractHandler.test.ts +++ b/test/unit/keeper/ContractHandler.test.ts @@ -1,6 +1,6 @@ import { assert } from 'chai' -import ContractHandler from '../../src/keeper/ContractHandler' -import { Ocean } from '../../src/ocean/Ocean' +import ContractHandler from '../../../src/keeper/ContractHandler' +import { Ocean } from '../../../src/ocean/Ocean' import config from '../config' describe('ContractHandler', () => { diff --git a/test/keeper/DIDRegistry.test.ts b/test/unit/keeper/DIDRegistry.test.ts similarity index 94% rename from test/keeper/DIDRegistry.test.ts rename to test/unit/keeper/DIDRegistry.test.ts index 537e950..c3101fc 100644 --- a/test/keeper/DIDRegistry.test.ts +++ b/test/unit/keeper/DIDRegistry.test.ts @@ -1,8 +1,8 @@ import { assert } from 'chai' -import DIDRegistry from '../../src/keeper/contracts/DIDRegistry' -import Account from '../../src/ocean/Account' -import { Ocean } from '../../src/ocean/Ocean' -import { generateId } from '../../src/utils/GeneratorHelpers' +import DIDRegistry from '../../../src/keeper/contracts/DIDRegistry' +import Account from '../../../src/ocean/Account' +import { Ocean } from '../../../src/ocean/Ocean' +import { generateId } from '../../../src/utils/GeneratorHelpers' import config from '../config' import TestContractHandler from './TestContractHandler' diff --git a/test/keeper/EventHandler.test.ts b/test/unit/keeper/EventHandler.test.ts similarity index 95% rename from test/keeper/EventHandler.test.ts rename to test/unit/keeper/EventHandler.test.ts index 7e40e33..f4ed8f6 100644 --- a/test/keeper/EventHandler.test.ts +++ b/test/unit/keeper/EventHandler.test.ts @@ -1,7 +1,7 @@ import { assert, expect, spy, use } from 'chai' import spies from 'chai-spies' -import { EventHandler } from '../../src/keeper/EventHandler' -import { Ocean } from '../../src/ocean/Ocean' +import { EventHandler } from '../../../src/keeper/EventHandler' +import { Ocean } from '../../../src/ocean/Ocean' import config from '../config' use(spies) diff --git a/test/keeper/Keeper.test.ts b/test/unit/keeper/Keeper.test.ts similarity index 89% rename from test/keeper/Keeper.test.ts rename to test/unit/keeper/Keeper.test.ts index 52f1d6d..7051dc7 100644 --- a/test/keeper/Keeper.test.ts +++ b/test/unit/keeper/Keeper.test.ts @@ -1,8 +1,8 @@ import { assert } from 'chai' import config from '../config' import TestContractHandler from './TestContractHandler' -import Keeper from '../../src/keeper/Keeper' -import { Ocean } from '../../src/ocean/Ocean' +import Keeper from '../../../src/keeper/Keeper' +import { Ocean } from '../../../src/ocean/Ocean' let keeper: Keeper diff --git a/test/keeper/TestContractHandler.ts b/test/unit/keeper/TestContractHandler.ts similarity index 97% rename from test/keeper/TestContractHandler.ts rename to test/unit/keeper/TestContractHandler.ts index 5487204..e06d625 100644 --- a/test/keeper/TestContractHandler.ts +++ b/test/unit/keeper/TestContractHandler.ts @@ -1,7 +1,7 @@ import { Contract } from 'web3-eth-contract' -import ContractHandler from '../../src/keeper/ContractHandler' -import Web3Provider from '../../src/keeper/Web3Provider' -import Logger from '../../src/utils/Logger' +import ContractHandler from '../../../src/keeper/ContractHandler' +import Web3Provider from '../../../src/keeper/Web3Provider' +import Logger from '../../../src/utils/Logger' import config from '../config' interface ContractTest extends Contract { diff --git a/test/keeper/conditions/AccessSecretStoreCondition.test.ts b/test/unit/keeper/conditions/AccessSecretStoreCondition.test.ts similarity index 89% rename from test/keeper/conditions/AccessSecretStoreCondition.test.ts rename to test/unit/keeper/conditions/AccessSecretStoreCondition.test.ts index 47040ab..a2990e0 100644 --- a/test/keeper/conditions/AccessSecretStoreCondition.test.ts +++ b/test/unit/keeper/conditions/AccessSecretStoreCondition.test.ts @@ -1,6 +1,6 @@ import { assert } from 'chai' -import { AccessSecretStoreCondition } from '../../../src/keeper/contracts/conditions' -import { Ocean } from '../../../src/ocean/Ocean' +import { AccessSecretStoreCondition } from '../../../../src/keeper/contracts/conditions' +import { Ocean } from '../../../../src/ocean/Ocean' import config from '../../config' import TestContractHandler from '../TestContractHandler' diff --git a/test/keeper/conditions/EscrowReward.test.ts b/test/unit/keeper/conditions/EscrowReward.test.ts similarity index 93% rename from test/keeper/conditions/EscrowReward.test.ts rename to test/unit/keeper/conditions/EscrowReward.test.ts index 361b59c..daa00e1 100644 --- a/test/keeper/conditions/EscrowReward.test.ts +++ b/test/unit/keeper/conditions/EscrowReward.test.ts @@ -1,6 +1,6 @@ import { assert } from 'chai' -import { EscrowReward } from '../../../src/keeper/contracts/conditions' -import { Ocean } from '../../../src/ocean/Ocean' +import { EscrowReward } from '../../../../src/keeper/contracts/conditions' +import { Ocean } from '../../../../src/ocean/Ocean' import config from '../../config' import TestContractHandler from '../TestContractHandler' diff --git a/test/keeper/conditions/LockRewardCondition.test.ts b/test/unit/keeper/conditions/LockRewardCondition.test.ts similarity index 90% rename from test/keeper/conditions/LockRewardCondition.test.ts rename to test/unit/keeper/conditions/LockRewardCondition.test.ts index 6b70668..f16f567 100644 --- a/test/keeper/conditions/LockRewardCondition.test.ts +++ b/test/unit/keeper/conditions/LockRewardCondition.test.ts @@ -1,6 +1,6 @@ import { assert } from 'chai' -import { LockRewardCondition } from '../../../src/keeper/contracts/conditions' -import { Ocean } from '../../../src/ocean/Ocean' +import { LockRewardCondition } from '../../../../src/keeper/contracts/conditions' +import { Ocean } from '../../../../src/ocean/Ocean' import config from '../../config' import TestContractHandler from '../TestContractHandler' diff --git a/test/mocha.opts b/test/unit/mocha.opts similarity index 76% rename from test/mocha.opts rename to test/unit/mocha.opts index c2d7346..a9c57ee 100644 --- a/test/mocha.opts +++ b/test/unit/mocha.opts @@ -5,4 +5,4 @@ --bail --exit --timeout 20000 -test/config.ts test/**/*.test.ts +test/unit/config.ts test/unit/**/*.test.ts diff --git a/test/mocks/Aquarius.mock.ts b/test/unit/mocks/Aquarius.mock.ts similarity index 76% rename from test/mocks/Aquarius.mock.ts rename to test/unit/mocks/Aquarius.mock.ts index 5fcead6..e5be8bb 100644 --- a/test/mocks/Aquarius.mock.ts +++ b/test/unit/mocks/Aquarius.mock.ts @@ -1,6 +1,6 @@ -import { Aquarius } from '../../src/aquarius/Aquarius' -import { DDO } from '../../src/ddo/DDO' -import DID from '../../src/ocean/DID' +import { Aquarius } from '../../../src/aquarius/Aquarius' +import { DDO } from '../../../src/ddo/DDO' +import DID from '../../../src/ocean/DID' const ddoStore: Map = new Map() diff --git a/test/mocks/Brizo.mock.ts b/test/unit/mocks/Brizo.mock.ts similarity index 85% rename from test/mocks/Brizo.mock.ts rename to test/unit/mocks/Brizo.mock.ts index 7efe47b..4d48e2a 100644 --- a/test/mocks/Brizo.mock.ts +++ b/test/unit/mocks/Brizo.mock.ts @@ -1,4 +1,4 @@ -import { Brizo } from '../../src/brizo/Brizo' +import { Brizo } from '../../../src/brizo/Brizo' export default class BrizoMock extends Brizo { public async initializeServiceAgreement( diff --git a/test/mocks/ContractBase.Mock.ts b/test/unit/mocks/ContractBase.Mock.ts similarity index 84% rename from test/mocks/ContractBase.Mock.ts rename to test/unit/mocks/ContractBase.Mock.ts index 21bc9b3..cf365f4 100644 --- a/test/mocks/ContractBase.Mock.ts +++ b/test/unit/mocks/ContractBase.Mock.ts @@ -1,4 +1,4 @@ -import ContractBase from '../../src/keeper/contracts/ContractBase' +import ContractBase from '../../../src/keeper/contracts/ContractBase' export default class ContractBaseMock extends ContractBase { public async initMock(config: any) { diff --git a/test/mocks/SecretStore.mock.ts b/test/unit/mocks/SecretStore.mock.ts similarity index 100% rename from test/mocks/SecretStore.mock.ts rename to test/unit/mocks/SecretStore.mock.ts diff --git a/test/mocks/WebServiceConnector.mock.ts b/test/unit/mocks/WebServiceConnector.mock.ts similarity index 100% rename from test/mocks/WebServiceConnector.mock.ts rename to test/unit/mocks/WebServiceConnector.mock.ts diff --git a/test/ocean/Account.test.ts b/test/unit/ocean/Account.test.ts similarity index 93% rename from test/ocean/Account.test.ts rename to test/unit/ocean/Account.test.ts index 031acd0..706b482 100644 --- a/test/ocean/Account.test.ts +++ b/test/unit/ocean/Account.test.ts @@ -1,7 +1,7 @@ import { assert } from 'chai' -import Web3Provider from '../../src/keeper/Web3Provider' -import Account from '../../src/ocean/Account' -import { Ocean } from '../../src/ocean/Ocean' +import Web3Provider from '../../../src/keeper/Web3Provider' +import Account from '../../../src/ocean/Account' +import { Ocean } from '../../../src/ocean/Ocean' import config from '../config' import TestContractHandler from '../keeper/TestContractHandler' diff --git a/test/ocean/DID.test.ts b/test/unit/ocean/DID.test.ts similarity index 97% rename from test/ocean/DID.test.ts rename to test/unit/ocean/DID.test.ts index a75f6b8..2107806 100644 --- a/test/ocean/DID.test.ts +++ b/test/unit/ocean/DID.test.ts @@ -1,5 +1,5 @@ import assert from 'assert' -import DID from '../../src/ocean/DID' +import DID from '../../../src/ocean/DID' describe('DID', () => { describe('#generate()', () => { diff --git a/test/ocean/Ocean.test.ts b/test/unit/ocean/Ocean.test.ts similarity index 91% rename from test/ocean/Ocean.test.ts rename to test/unit/ocean/Ocean.test.ts index acc5f4a..d56ebb0 100644 --- a/test/ocean/Ocean.test.ts +++ b/test/unit/ocean/Ocean.test.ts @@ -1,8 +1,8 @@ import { assert, spy, use } from 'chai' import spies from 'chai-spies' -import Account from '../../src/ocean/Account' -import { Ocean } from '../../src/ocean/Ocean' +import Account from '../../../src/ocean/Account' +import { Ocean } from '../../../src/ocean/Ocean' import config from '../config' import TestContractHandler from '../keeper/TestContractHandler' diff --git a/test/ocean/OceanAccounts.test.ts b/test/unit/ocean/OceanAccounts.test.ts similarity index 88% rename from test/ocean/OceanAccounts.test.ts rename to test/unit/ocean/OceanAccounts.test.ts index ba68775..ea19e8a 100644 --- a/test/ocean/OceanAccounts.test.ts +++ b/test/unit/ocean/OceanAccounts.test.ts @@ -2,9 +2,9 @@ import { assert, spy, use } from 'chai' import spies from 'chai-spies' import config from '../config' -import Account from '../../src/ocean/Account' -import { Ocean } from '../../src/ocean/Ocean' -import { OceanAccounts } from '../../src/ocean/OceanAccounts' +import Account from '../../../src/ocean/Account' +import { Ocean } from '../../../src/ocean/Ocean' +import { OceanAccounts } from '../../../src/ocean/OceanAccounts' use(spies) diff --git a/test/ocean/OceanAssets.test.ts b/test/unit/ocean/OceanAssets.test.ts similarity index 90% rename from test/ocean/OceanAssets.test.ts rename to test/unit/ocean/OceanAssets.test.ts index 7e60c02..f8d8d62 100644 --- a/test/ocean/OceanAssets.test.ts +++ b/test/unit/ocean/OceanAssets.test.ts @@ -1,8 +1,8 @@ import { assert, spy, use } from 'chai' import spies from 'chai-spies' -import { SearchQuery } from '../../src/aquarius/Aquarius' -import { Ocean } from '../../src/ocean/Ocean' +import { SearchQuery } from '../../../src/aquarius/Aquarius' +import { Ocean } from '../../../src/ocean/Ocean' import config from '../config' use(spies) diff --git a/test/ocean/OceanAuth.test.ts b/test/unit/ocean/OceanAuth.test.ts similarity index 95% rename from test/ocean/OceanAuth.test.ts rename to test/unit/ocean/OceanAuth.test.ts index 1c43c4f..9f3e285 100644 --- a/test/ocean/OceanAuth.test.ts +++ b/test/unit/ocean/OceanAuth.test.ts @@ -2,9 +2,9 @@ import { assert, expect, spy, use } from 'chai' import spies from 'chai-spies' import config from '../config' -import Account from '../../src/ocean/Account' -import { Ocean } from '../../src/ocean/Ocean' -import { OceanAuth } from '../../src/ocean/OceanAuth' +import Account from '../../../src/ocean/Account' +import { Ocean } from '../../../src/ocean/Ocean' +import { OceanAuth } from '../../../src/ocean/OceanAuth' use(spies) diff --git a/test/ocean/OceanSecretStore.test.ts b/test/unit/ocean/OceanSecretStore.test.ts similarity index 85% rename from test/ocean/OceanSecretStore.test.ts rename to test/unit/ocean/OceanSecretStore.test.ts index 7e813cc..d1d1366 100644 --- a/test/ocean/OceanSecretStore.test.ts +++ b/test/unit/ocean/OceanSecretStore.test.ts @@ -1,9 +1,9 @@ import { assert, expect, spy, use } from 'chai' import spies from 'chai-spies' -import Account from '../../src/ocean/Account' -import { Ocean } from '../../src/ocean/Ocean' -import { OceanSecretStore } from '../../src/ocean/OceanSecretStore' +import Account from '../../../src/ocean/Account' +import { Ocean } from '../../../src/ocean/Ocean' +import { OceanSecretStore } from '../../../src/ocean/OceanSecretStore' import config from '../config' use(spies) diff --git a/test/ocean/utils/SignatureUtils.test.ts b/test/unit/ocean/utils/SignatureUtils.test.ts similarity index 97% rename from test/ocean/utils/SignatureUtils.test.ts rename to test/unit/ocean/utils/SignatureUtils.test.ts index 3bbdfcf..ec6c5a5 100644 --- a/test/ocean/utils/SignatureUtils.test.ts +++ b/test/unit/ocean/utils/SignatureUtils.test.ts @@ -3,7 +3,7 @@ import spies from 'chai-spies' import Web3 from 'web3' import config from '../../config' -import { Ocean } from '../../../src/ocean/Ocean' +import { Ocean } from '../../../../src/ocean/Ocean' use(spies) diff --git a/test/testdata/ddo.json b/test/unit/testdata/ddo.json similarity index 100% rename from test/testdata/ddo.json rename to test/unit/testdata/ddo.json diff --git a/test/tsconfig.json b/test/unit/tsconfig.json similarity index 100% rename from test/tsconfig.json rename to test/unit/tsconfig.json diff --git a/test/utils/ConversionTypeHelpers.test.ts b/test/unit/utils/ConversionTypeHelpers.test.ts similarity index 97% rename from test/utils/ConversionTypeHelpers.test.ts rename to test/unit/utils/ConversionTypeHelpers.test.ts index 3fbf19b..ff94bf4 100644 --- a/test/utils/ConversionTypeHelpers.test.ts +++ b/test/unit/utils/ConversionTypeHelpers.test.ts @@ -4,7 +4,7 @@ import { noZeroX, didPrefixed, noDidPrefixed -} from '../../src/utils/ConversionTypeHelpers' +} from '../../../src/utils/ConversionTypeHelpers' describe('ConversionTypeHelpers', () => { describe('#zeroXTransformer()', () => { diff --git a/test/utils/GeneratorHelpers.test.ts b/test/unit/utils/GeneratorHelpers.test.ts similarity index 91% rename from test/utils/GeneratorHelpers.test.ts rename to test/unit/utils/GeneratorHelpers.test.ts index a822a34..243893d 100644 --- a/test/utils/GeneratorHelpers.test.ts +++ b/test/unit/utils/GeneratorHelpers.test.ts @@ -1,5 +1,5 @@ import { assert } from 'chai' -import { generateId } from '../../src/utils/GeneratorHelpers' +import { generateId } from '../../../src/utils/GeneratorHelpers' describe('GeneratorHelpers', () => { describe('#generateId()', () => { diff --git a/test/utils/SubscribableObserver.test.ts b/test/unit/utils/SubscribableObserver.test.ts similarity index 96% rename from test/utils/SubscribableObserver.test.ts rename to test/unit/utils/SubscribableObserver.test.ts index 592b3c3..796259b 100644 --- a/test/utils/SubscribableObserver.test.ts +++ b/test/unit/utils/SubscribableObserver.test.ts @@ -1,7 +1,7 @@ import { assert, expect, spy, use } from 'chai' import spies from 'chai-spies' -import { SubscribableObserver } from '../../src/utils/SubscribableObserver' +import { SubscribableObserver } from '../../../src/utils/SubscribableObserver' use(spies) diff --git a/test/utils/SubscribablePromise.test.ts b/test/unit/utils/SubscribablePromise.test.ts similarity index 98% rename from test/utils/SubscribablePromise.test.ts rename to test/unit/utils/SubscribablePromise.test.ts index 850419a..5f7d8bd 100644 --- a/test/utils/SubscribablePromise.test.ts +++ b/test/unit/utils/SubscribablePromise.test.ts @@ -1,7 +1,7 @@ import { assert, expect, spy, use } from 'chai' import spies from 'chai-spies' -import { SubscribablePromise } from '../../src/utils/SubscribablePromise' +import { SubscribablePromise } from '../../../src/utils/SubscribablePromise' use(spies)