Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clarinet test should be able to not fail on ts compile #282

Closed
moodmosaic opened this issue Mar 9, 2022 · 5 comments
Closed

clarinet test should be able to not fail on ts compile #282

moodmosaic opened this issue Mar 9, 2022 · 5 comments

Comments

@moodmosaic
Copy link
Contributor

moodmosaic commented Mar 9, 2022

If Clarinet.test calls into Deno.test, then can we pass flags in clarinet test that will be then passed into deno test?

I'm particularly interested in the --no-check flag.

So something like this is what I need:

clarinet test --no-check # internally calls `deno test --no-check`

I'm working on model-based testing for Clarity contracts, similar to what Echidna does for Solidity contracts, and there are some parts in my tests that are syntactically valid JavaScript, but the TypeScript part won't type-check for several reasons (e.g. .d.ts file missing).

If there's a way to supply a custom flag in deno then that would be great, if not I'd be happy to submit a PR for it.

@moodmosaic
Copy link
Contributor Author

/cc @lgalabru

@moodmosaic
Copy link
Contributor Author

moodmosaic commented Mar 11, 2022

I think I got the answer for this. It appears that an older version of deno is used. In the most recents versions of it, deno should no longer type check, just transpile, and so there's no we might not even need to pass --no-check.

Any concerns wrt pulling the latest from deno upstream and applying hirosystems/deno/tree/clarinet/patch-v3 on top of it? I'd be happy to work on that, if you agree. @lgalabru @obycode


For the time being, I can just use // @ts-nocheck for the feature I'm working on.

@moodmosaic moodmosaic changed the title Is there a way to pass flags to deno? clarinet test should not fail on ts compile Mar 11, 2022
@lgalabru
Copy link
Contributor

lgalabru commented Mar 11, 2022

hey @moodmosaic!
glad to hear that you found a way out, thanks for looking into this. the version of deno that we are embedding is relatively recent, and the no-check foot gun is actually present, it is just not exposed to developers.
You'd have to add a new flag (false by default) to clarinet test - maybe ts-no-check to disambiguate with clarity checks - here:

struct Test {

and pass it all the way down to:

let program_state = ProgramState::build(flags.clone()).await?;

@obycode and I are pretty busy with our backlog, but if you have the bandwidth and a use case for this ask, I'd be supportive :)

@lgalabru
Copy link
Contributor

I'm working on model-based testing for Clarity contracts, similar to what Echidna does for Solidity contracts

Looks fascinating! do you have a repo that we can watch / star?

@lgalabru lgalabru changed the title clarinet test should not fail on ts compile clarinet test should be able to not fail on ts compile Mar 11, 2022
@moodmosaic
Copy link
Contributor Author

I think I'm fine for now with // @ts-nocheck so I'll see if a PR that adds ts-no-check is even needed. As for the stuff I'm on, I don't have something up yet, but if I do, I will ping you. Thanks @lgalabru!


Closing for now, and if (a PR) needed I will reopen. Thanks again for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants