ocean.js
ocean.js copied to clipboard
Issue-#1195: "C2D Flow" README works in v4
Fixes #1195
Changes proposed in this PR:
- Add
C2DExamples.test.ts
test script - Generate automatically
C2DExamples.md
markdown file
@miquelcabot I have updated the workflow so:
- user touches marketplace.json
- sed matches and replace the import config path.
Hi @miquelcabot and @jamiehewitt15 I tagged both of you as I saw your names in the github annotations. I'm reviewing the script for createCodeExamples.sh and I'm continuing to run into issues:
- Tutorial suggest user to create a .js file but all the inner workings are in .ts
- shell script is using sed to remove chai test functions such as before() and it(), but it fails to properly substitute for an async function
- There is nothing in the documentation that tells what the user needs to compile from .ts => .js, and run it. If the user tries to use
node marketplace.js
he will receive ES6 import-related errors.
I understand the overall drive to want to go from an internal .ts test => clean documentation, but this seems like more effort than it's worth and perhaps fragile too. I.E. Why not just have the documentation.md updated?
Cheers!
Here is another issue.
The following import is local to ocean.js / test folder.
import { getAddresses, getTestConfig, web3 } from '../config'
Meaning that the config helper functions above are not bundled/exported with the @oceanprotocol/lib
module.
Downstream, when the user is going through the marketplace or C2D flow, he will try to import this from @oceanprotocol/lib, and will be unable to.
Code Climate has analyzed commit 0db80125 and detected 0 issues on this pull request.
The test coverage on the diff in this pull request is 100.0% (50% is the threshold).
This pull request will bring the total coverage in the repository to 73.2%.
View more on Code Climate.
@miquelcabot do you have an idea of why the tests are failing?
@jamiehewitt15 No. I'm reviewing it. But the error comes from a file that I haven't modified :(
@jamiehewitt15 I have seen that these tests are also failing in the main
branch. Any ideas about what can be failing? @mihaisc @bogdanfazakas
The test that is failing is ComputeFlow.test.ts
.
@jamiehewitt15 I have seen that these tests are also failing in the
main
branch. Any ideas about what can be failing? @mihaisc @bogdanfazakas The test that is failing isComputeFlow.test.ts
.
Ah ok, I guess it's an issue with compute to data then that should be handled in a separate PR
By now tending towards @idiom-bytes's suggestion of simply writing stuff in the markdown files and be done with it.
If that's the direction we go in then we could just abandon this altogether and then make sure we're covering everything properly in the docs. The readme here can be updated with links to the relevant tutorials, similar to how we have done it in the market
Closing this since it is handled in #1615