1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00

Merge branch 'master' into feature/compute

This commit is contained in:
Matthias Kretschmann 2020-01-31 00:17:28 +01:00
commit 17b5b0a4ec
Signed by: m
GPG Key ID: 606EEEF3C479A91F
27 changed files with 64 additions and 64 deletions

View File

@ -7,8 +7,8 @@
},
"project": [
"./tsconfig.json",
"./test/tsconfig.json",
"./integration/tsconfig.json"
"./test/unit/tsconfig.json",
"./test/integration/tsconfig.json"
]
},
"extends": [

View File

@ -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

View File

@ -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

View File

@ -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}'",
@ -107,7 +107,7 @@
"ts-node/register"
],
"reporter": [
"text-summary",
"text",
"lcov",
"html"
],

View File

@ -4,4 +4,4 @@
--full-trace
--exit
--timeout 300000
integration/**/*.test.ts
test/integration/**/*.test.ts

View File

@ -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<string, any> = new Map<string, any>()

View File

@ -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'

View File

@ -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'

View File

@ -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', () => {

View File

@ -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'

View File

@ -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

View File

@ -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 {

View File

@ -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'

View File

@ -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'

View File

@ -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'

View File

@ -5,4 +5,4 @@
--bail
--exit
--timeout 20000
test/config.ts test/**/*.test.ts
test/unit/config.ts test/unit/**/*.test.ts

View File

@ -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'

View File

@ -1,5 +1,5 @@
import assert from 'assert'
import DID from '../../src/ocean/DID'
import DID from '../../../src/ocean/DID'
describe('DID', () => {
describe('#generate()', () => {

View File

@ -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'

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -4,7 +4,7 @@ import {
noZeroX,
didPrefixed,
noDidPrefixed
} from '../../src/utils/ConversionTypeHelpers'
} from '../../../src/utils/ConversionTypeHelpers'
describe('ConversionTypeHelpers', () => {
describe('#zeroXTransformer()', () => {

View File

@ -1,5 +1,5 @@
import { assert } from 'chai'
import { generateId } from '../../src/utils/GeneratorHelpers'
import { generateId } from '../../../src/utils/GeneratorHelpers'
describe('GeneratorHelpers', () => {
describe('#generateId()', () => {

View File

@ -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)