Milans-MacBook-Air:paratii-lib milankragujevic$ yarn test
yarn run v1.3.2
$ mocha --require babel.js --exit --timeout 10000 test/*.js
Paratii API:
โ deployContracts should deploy and register all contracts (497ms)
Paratii API:
โ diagnose() should run without errors (318ms)
Paratii API:
4
โ example session from ../docs/example-session.md should work (235ms)
Paratii configuration:
โ paratii.config should return the configuration with default values
โ testnet configuration should be recognized
โ should be possible to create a second Paratii object with the same settings (244ms)
โ should be possible to create a Paratii instance without an address or registryAddress
โ setAccount should set the account
โ paratii.eth.web3 should be available
paratii.core API: :
โ should be configured
- core.users.create() should work as expected
- core.users.get() should work as expected
paratii.core.vids:
bitswap options: { maxMessageSize: 32768 }
โ core.vids.create() and get() should work as expected (5024ms)
bitswap options: { maxMessageSize: 32768 }
โ core.vids.create() should accept ipfsHash as argument (5435ms)
bitswap options: { maxMessageSize: 32768 }
โ core.vids.update() should work as expected (1567ms)
- core.vids.delete() should work as expected
- core.vids.like() should work as expected
- core.vids.dislike() should work as expected
- core.vids.view() should work as expected
- core.vids.buy() should work as expected
- core.vids.search() should work as expected
paratii.db API: :
โ should be configured
- db.vids.get() should work as expected
- db.users.get() should work as expected
- db.vids.search() should work as expected
โ should be available as an attribute on Paratii instances
paratii.eth.events API: :
โ subscription to Tranfer PTI events should work as expected (70ms)
โ subscription to Create Video events should work as expected (45ms)
paratii.eth API: :
โ getContracts() should return the contracts
โ contracts should have their address set (70ms)
โ getContract() should return the correct contract
1) balanceOf() should return the right balances
โ transfer ETH should work as expected
โ transfer PTI should work as expected
โ deployContract should throw a sensible error if address is not set
paratii.eth.users: :
โ users.create(), .get(), .update() and .delete() should work (83ms)
- missing or wrong arguments in users.create() should trhow meaningful errors
paratii.eth.vids:
โ vids.create(), .get(), .update() and .delete() should work (83ms)
- vids.create() should throw meaningful errors
- vids.create() should create a fresh id if no id wat provided
paratii.eth.wallet: :
โ init account is added to wallet
โ if no account is given, the wallet accounts are empty
โ wallet.create() works (165ms)
โ wallet.create() does not create a new wallet object (156ms)
โ wallet.create() creates a new mnenomic if not mnomic is given (49ms)
โ wallet.encrypt() and decrypt() works (546ms)
โ send() should fail if no wallet is present
โ send() should succeed if a private key is passed to the constructor (43ms)
โ send() should succeed if a private key is passed to the constructor (44ms)
โ eth.wallet.isValidMnemonic() should work as expected
โ eth.wallet.newMnemonic() should work as expected
โ eth.wallet.create() should throw if a wallet already has an account
โ eth.wallet.getMnemonic() should work as expected (71ms)
ParatiiIPFS: :
โ should exist
bitswap options: { maxMessageSize: 32768 }
โ should create an instance without trouble (2914ms)
bitswap options: { maxMessageSize: 32768 }
โ should allow for simple add() and get() of files (778ms)
bitswap options: { maxMessageSize: 32768 }
โ put a JSON object and get it back (3370ms)
bitswap options: { maxMessageSize: 32768 }
โ should exist and work as an attribute on the Paratii object (870ms)
ParatiiIPFS: :
{ onDone: [Function: onDone], onError: [Function: onError] }
bitswap options: { maxMessageSize: 32768 }
Adding test/data/some-file.txt
Adding QmS8yinWCD1vm7WJx34tg81FpjEXbdYXf3Y5XcCeh29C6K finished
uploader Finished [ undefined ]
โ should allow for file upload (3444ms)
bitswap options: { maxMessageSize: 32768 }
reading file genericJson.json
reading file some-file.txt
this is the hash to return
โ should add a directory to IPFS (3270ms)
bitswap options: { maxMessageSize: 32768 }
uploader Finished []
_signalTranscoder Got an empty Array. files: []
โ addAndTranscode() should work as expected (6580ms)
- should be able to grab a youtube video and upload it
- should be able to grab a vimeo video and upload it
Paratii API:
โ paratii exists..
47 passing (41s)
16 pending
1 failing
1) paratii.eth API: :
balanceOf() should return the right balances:
Error: Private key suspiciously small: < 16 bytes. Aborting!
at Wallet.create$ (lib/paratii.eth.wallet.js:36:17)
at tryCatch (node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:62:40)
at Generator.invoke [as _invoke] (node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:296:22)
at Generator.prototype.(anonymous function) [as next] (node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:114:21)
at tryCatch (node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:62:40)
at invoke (node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:152:20)
at node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:195:11
at new Promise (<anonymous>)
at callInvokeWithMethodAndArg (node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:194:16)
at AsyncIterator.enqueue (node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:217:13)
at AsyncIterator.prototype.(anonymous function) [as next] (node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:114:21)
at Object.runtime.async (node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:241:14)
at Wallet.create (lib/paratii.eth.wallet.js:7:3)
at Context._callee5$ (test/paratii.eth.js:76:45)
at tryCatch (node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:62:40)
at Generator.invoke [as _invoke] (node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:296:22)
at Generator.prototype.(anonymous function) [as next] (node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:114:21)
at tryCatch (node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:62:40)
at invoke (node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:152:20)
at node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:195:11
at new Promise (<anonymous>)
at callInvokeWithMethodAndArg (node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:194:16)
at AsyncIterator.enqueue (node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:217:13)
at AsyncIterator.prototype.(anonymous function) [as next] (node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:114:21)
at Object.runtime.async (node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:241:14)
at Context._callee5 (test/paratii.eth.js:72:54)
at <anonymous>
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Milans-MacBook-Air:paratii-lib milankragujevic$
On macOS 10.13 with 8GB of RAM.