8000 jest doesn't exist as an adder · Issue #5 · rossyman/svelte-add-jest · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

jest doesn't exist as an adder #5

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

Closed
bertrandlalo opened this issue Jul 20, 2021 · 13 comments · Fixed by #6
Closed

jest doesn't exist as an adder #5

bertrandlalo opened this issue Jul 20, 2021 · 13 comments · Fixed by #6
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@bertrandlalo
Copy link

Dear authors,

First of all, thank you for the repo initiative!

I'm trying to configure jest test on a SvelteKit project.

Here is what I did :

  • Node v14.15.0
  • I ran npm init svelte@next and chose typescript
  • I removed the commented lined in tsconfig file
  • I ran npx svelte-add jest

Here is the following output:

npx: installed 61 in 3.123s
➕ Svelte Add (Version 2021.06.30.01)
The project directory you're giving to this command cannot be determined to be guaranteed fresh — maybe it is, maybe it isn't. If any issues arise after running this command, please try again, making sure you've run it on a freshly initialized SvelteKit or Vite–Svelte app template.

jest
  ❌ doesn't exist as an adder. Have you spelled it correctly?

Do you have any idea of what I might have done wrong?

++

@rossyman
Copy link
Owner

We're going to resolve this soon. We were waiting on the @svelte-add org to update their architecture (therefore, we didn't merge our adder officially), however, we've decided to push on with what we have at the moment for the benefit of the community.

You can track the progress of the architecture change in the following issue:

I'll also keep you updated with when you can use this adder @bertrandlalo

@rossyman rossyman self-assigned this Jul 20, 2021
@rossyman rossyman added bug Something isn't working documentation Improvements or additions to documentation labels Jul 20, 2021
@rossyman
Copy link
Owner

Documentation's been updated -- Hope this clarifies things for you @bertrandlalo

@bertrandlalo
Copy link
Author
bertrandlalo commented Jul 21, 2021

Thank you very much 🙌

I'm trying npx apply rossyman/svelte-add-jest. but I have this error :
usage: apply [-a magic] [-d] [-0123456789] command arguments ... 😔

And when I had the flag no-ssh, I get no such file or directory: rossyman/svelte-add-jest

Any idea?

PS: If ever you had even an example of what files/config should be created after running those commands, it would help me a lot... I'm desperate to integrate some tests to my svelte-kit application....

@rossyman
Copy link
Owner

Thank you very much 🙌

I'm trying npx apply rossyman/svelte-add-jest. but I have this error :
usage: apply [-a magic] [-d] [-0123456789] command arguments ... 😔

And when I had the flag no-ssh, I get no such file or directory: rossyman/svelte-add-jest

Any idea?

PS: If ever you had even an example of what files/config should be created after running those commands, it would help me a lot... I'm desperate to integrate some tests to my svelte-kit application....

I'll try to replicate and investigate now, in the meantime, can you confirm that:

  • a) You're running this command on a SvelteKit project
  • b) You've CD'd into the SvelteKit project

@bertrandlalo
Copy link
Author

Yes, I do confirm that I'm on a SvelteKit project.
I even tried to do a fresh one from start using npm init svelte@next.

I'm on MacOs, zsh, with Node v14.16.0.

A friend tried on windows and got the following error:

[ info ]  Applying preset rossyman/svelte-add-jest.
../../../Users/derfu/AppData/Local/Temp/tmp-16732-03YQ1klXEeNf/preset.ts:1:41: error: Could not resolve "comment-json" (mark it as external to exclude it from the bundle)
    1 │ import { assign, parse, stringify } from 'comment-json';
      ╵                                          ~~~~~~~~~~~~~~

@rossyman
Copy link
Owner

Screenshot 2021-07-21 at 21 14 52

I've managed to replicate the issue and also seen the above error from your last message -- It's a known limitation of Preset (Which we use to orchestrate the changes) -- I'm working on a fix now.

@bertrandlalo
Copy link
Author

Thank you so much. Let me know if there's anything I can do to help!

This was referenced Jul 21, 2021
@rossyman
Copy link
Owner
rossyman commented Jul 21, 2021

We've rolled back the JSON-C changes for now, as Preset doesn't support modifying JSON files that have comments in them or have support for external dependencies.

We've also raised an issue with the Preset team, specifically to do with making the error handling logic easier for us:

In the meantime, apart from the caveat of not being able to have comments in your tsconfig.json file when running our adder, you should be good to go! Let us know how it goes 😄 @bertrandlalo

@bertrandlalo
Copy link
Author

Still have the error 😔
issue-npx-add

@rossyman
Copy link
Owner

Screenshot 2021-07-21 at 22 30 50

Interesting, I can't seem to replicate the error on my side. Give me some time to investigate again. Thanks for bearing with me.

@rossyman
Copy link
Owner

Screenshot 2021-07-21 at 22 33 41

One thing to note, is that ZSH / Mac seems to have a built in binary called apply -- I wonder if there's an issue in your path that seems to be causing your terminal to somehow use the built in apply, rather than the one sourced from the NPM registry.

@bertrandlalo
Copy link
Author

Wow, great, nice catchI I used a bash terminal to see if zsh was the problem and it worked well 🙏👌🙌

(the test fails though on expect(getByText('Hello world!')).toBeInTheDocument(); !

Thank you very much for your help. Tomorrow, I'll try to use all this on my actual project.

💃❤️

@rossyman
Copy link
Owner

Wow, great, nice catchI I used a bash terminal to see if zsh was the problem and it worked well 🙏👌🙌

(the test fails though on expect(getByText('Hello world!')).toBeInTheDocument(); !

Thank you very much for your help. Tomorrow, I'll try to use all this on my actual project.

💃❤️

Fab! The intention was for the test to fail -- Forces the developer to make it pass, if you don't want the example test files, you can pass in the --no-examples flag. I'll close this issue now, have a nice day 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully me 34FD rging a pull request may close this issue.

2 participants
0