-
Notifications
You must be signed in to change notification settings - Fork 10
Instructions do not work on Angular 10 CLI project #1
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
Comments
I also tried the previous version. And while this time I could |
Hi! Thanks for checking out the library! I'm sorry but unfortunately I'm not familiarized at all with how Karma works. So far I've only been using the library to test a React app at work. From what I've been reading today, a plugin is needed to add the matchers. Actually, the most popular library for jasmine matchers has a karma plugin to handle this. I'd try to have a look at it but I don't really have the time to study Karma and develop the plugin at the moment. You're more than welcome to do so if you can and want to! If you come up with a solution or develop the plugin, a PR to update the docs would be great 😄 |
Hi, I've taken a look at how the library you linked works - and I think all its doing is adding a file to the Like:
So I thought we just need to do that for your library - but in trying to do that I get
It seems that To test I just:
Then saw the error 😦 |
In order to try to get around the error importing Because of that error I tried just adding
|
Just looked some more - and the |
I've forked you here: https://github.com/IanGrainger/jasmine-dom and removed the I've also published my fork to Thanks! |
Hey, that's great! I believe ideally we should try to update this module, but I think that adding your fork to the docs will be fine as a temporary solution. If you want to update the docs to reference your fork, that would be great. Otherwise, I'll do it over the weekend! I'll leave this issue open for further discussion until we come up with a solution. Thank you for your work! |
Yes - of course it'd be better to fix this repo! But I'm not sure what to do about the broken |
I now have 2 open PRs on the CSS library to get a workaround to allow it to work for parsing in the browser. It will still fail to stringify with sourcemap support - but that's not something you're using here. I started making a version of this repo in typescript for the other issue, because Angular uses it, you need to add to the global namespace to get the tests to compile - but by the time I got to setting up webpack to get the tests to run I thought it was getting to a lot of effort! 😉 I do now have an example of the changes I'd need to add to the
|
@brrianalexis still have two PRs waiting approval on the CSS library :( any idea what I have to do to get someone to approve them? I'm new to contributing to npm (if that wasn't obvious)... Pay them? 😆 I'm wondering if an alternative would be a new library that just exports the bit of the CSS library you need here? a |
@IanGrainger hey! I'm really sorry for dropping the ball on this one. I've been really busy lately focused on getting a new job. I'm new to npm and open source in general too, don't worry 😅 Let's see if I understood correctly:
By this you mean the declaration file, right? If that's the case, then you can change it here in
That would definitely be an alternative. I've thought about it myself too. I don't know if it would be too much work to do it 🤔 |
@brrianalexis no worries, I hope you got a good job! 👍 I've pr'd the global namespace change here: DefinitelyTyped/DefinitelyTyped#49510. Re: reexporting, I wasn't sure if the |
Oh dear, looks like there's some problems with the global namespace stuff - mainly that it isn't allowed, apparently... https://github.com/DefinitelyTyped/DefinitelyTyped/runs/1390683036 |
I'm not a typescript expert at all, but have you tried with just changing the already existing definitions? 🤔 |
Err - you might be right - but if I can't add to the global namespace
(which it said I can't), then I'm not sure if it'll be available for
intellisense. It needs more work.
…On Thu, Nov 12, 2020 at 3:09 PM Brian Alexis ***@***.***> wrote:
I'm not a typescript expert at all, but have you tried with just changing
the already existing definitions? 🤔
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIELT6FBWFVTZIBMNXHXDW3SPP3CPANCNFSM4RUSX6YA>
.
--
*Ian Grainger*
Development Lead
01223 607676
*this.isfluent.com <http://this.isfluent.com/>*
--
Fluent (Cambridge) Ltd is a limited company registered in England and
Wales No. 6159670.
Registered office 7 Pioneer Court
<https://this.isfluent.com/contact>, Vision Park, Histon, Cambridge. CB24
9PT
|
…sted by css library project member
reworkcss/css#146 have suggested a better fix. Just import the parse function - PR here: #8 |
To allow people to use Karma, I think you still need to add a line to your Getting Started: files: add to karma.conf.js: |
Now that #8 is merged, do we need to update the docs? If so, you're more than welcome to do it. Otherwise, let me know and I'll update them! |
Docs need: Usage with Karma and Typescript in an Angular 10 project:
I think adding to Does it definitely work with Jest when you import from |
@brrianalexis I wonder if you could add a file which does: |
This package is for Jasmine. If you're using Jest, it's a bit more simple to set up using jest-dom In my case, I always imported directly from
I'm not really sure about that. Have you tried it in your fork? |
Sorry, I meant whatever you were using, so Javascript, not Jest 😆.
It was just so people didn't need to add the file themselves - seeing as the content is always the same... But it differs if you're using JS or TS it seems! |
Awesome. Is this all that needs to be added to the docs? |
Yep, that'll work, great 👍 (or at least it did in my test project). Only thing I was toying with was suggesting you add a new file to the |
@IanGrainger, I've put up a new PR #10 to update the docs. Please review it and feel free to suggest any changes 🙏🏻 |
I have an Angular 10 CLI project (v10.1.2). I've installed
@testing-library/angular@10.0.2
, but as I'm using Karma (configured via Angular) and Typescript, I'm not sure how to install this library!I tried following the instructions for the latest version (v1.1.0), but while I can see the matchers on the
HTMLMatchers
type in VSCode, I can't actually add the Matchers, because trying to import them withimport JasmineDOM from '@testing-library/jasmine-dom';
gives an errorFile C:/.../node_modules/@types/testing-library__jasmine-dom/index.d.ts is not a module
.As this is an Angular CLI project, would it actually make more sense to use a karma plugin!?
The text was updated successfully, but these errors were encountered: