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

fast-check has no exported member named 'Command' #2779

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

fast-check has no exported member named 'Command' #2779

moodmosaic opened this issue Mar 9, 2022 · 6 comments

Comments

@moodmosaic
Copy link

moodmosaic commented Mar 9, 2022

💬 Question and Help

Getting this error when loading fast-check via Skypack in a Deno test suite:

fast-check has no exported member named 'Command'

import * as fc
  from 'https://cdn.skypack.dev/fast-check';

class PushCommand implements fc.Command<Model, List> {
                                ^^^^^^^
  constructor(readonly value: number) { }

  check = (m: Readonly<Model>) =>
    true;

  run(m: Model, r: List): void {
    r.push(this.value); // impact the system
    ++m.num;            // impact the model
  }

  toString = () =>
    `push(${this.value})`;
}

Any help would be appreciated.

@moodmosaic
Copy link
Author

Got it, have to run deno with --no-check option as in denoland/deno#3321 (comment).

@moodmosaic
Copy link
Author

@dubzzz I guess the alternative is to include those types in the .d.ts definitions? Or is there a way to trick the TypeScript compiler as-is?

@dubzzz
Copy link
Owner

dubzzz commented Mar 11, 2022

It's quite surprising as I do export Command in the code 🤔
See there: https://github.com/dubzzz/fast-check/blob/main/src/fast-check-default.ts#L322

@dubzzz
Copy link
Owner

dubzzz commented Mar 11, 2022

And it appears in the generated and published typings https://cdn.jsdelivr.net/npm/[email protected]/lib/types/fast-check-default.d.ts.

So it rather seem to be an issue on Skypack side? They probably ignore types published without any backing JS code (in other words pure types like this one).

@moodmosaic
Copy link
Author

Just wondering, is Skypack the only way to use fast-check from deno?

@dubzzz
Copy link
Owner

dubzzz commented Mar 12, 2022

Unfortunately, the only one I know of today. I just gave a try to something like jsdelivr but the main problem is that it would break because of dependencies not being referenced by an explicit url. In order to really support deno I should potentially do as I do for esm/cjs builds and add yet another build but it would imply some extra post-processing on the file generated by tsc.

Just opened a dedicated issue to track this need #2781. No plan to work on it in the coming days but it would help me not to forget about it for the next features.

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