Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 21:05

    nlundquist on master

    Update dist for release (compare)

  • 21:05

    nlundquist on v6.2.6

    Update dist for release 6.2.6 (compare)

  • 20:22
    cherifGsoul review_requested #5425
  • 20:22
    cherifGsoul commented #5425
  • 20:19
    cherifGsoul synchronize #5425
  • 20:19

    cherifGsoul on obserbale-properties-update-debugging-guid

    Fix observable properties wordi… (compare)

  • 20:12

    nlundquist on master

    update can-stache-converters de… (compare)

  • 20:12
    nlundquist closed #5424
  • 19:24
    cherifGsoul review_requested #5425
  • 19:24
    cherifGsoul opened #5425
  • 19:21

    cherifGsoul on obserbale-properties-update-debugging-guid

    Remove ViewModel wording from d… (compare)

  • 19:20

    phillipskevin on same-as-master

    (compare)

  • Nov 17 21:58
  • Nov 14 17:40
    nlundquist edited #5424
  • Nov 14 17:40
    nlundquist edited #5424
  • Nov 14 17:39
    nlundquist opened #5424
  • Nov 14 17:39
    nlundquist review_requested #5424
  • Nov 14 17:39

    nlundquist on 107-update-converter-demos

    update can-stache-converters de… (compare)

  • Nov 14 14:32
    greenkeeper[bot] labeled #5423
  • Nov 14 14:32
    greenkeeper[bot] opened #5423
Gregg Roemhildt
@roemhildtg
image.png
Kevin Phillips
@phillipskevin
what if you wrap Error occurs here when selectedProject gets set in an element?
Gregg Roemhildt
@roemhildtg
Nope
Kevin Phillips
@phillipskevin
ok, if you can reproduce it in a codepen I can take a look
later tonight / tomorrow morning
Gregg Roemhildt
@roemhildtg
Is there a canjs symbol for something like "can.forEach"?
Kevin Phillips
@phillipskevin
there is CanSymbol.iterator
Gregg Roemhildt
@roemhildtg
If I add that, it'll call that function in stache for of ?
Kevin Phillips
@phillipskevin
you're trying to create your own observable you mean?
Gregg Roemhildt
@roemhildtg
Correct. Its kind of like an array...it has a toArray method, and a length property but its not like a normal array where you can do array[0]. So I thought I'd build an iterator function
Kevin Phillips
@phillipskevin
you would need more symbols than that
definitely isObservableLike and isListLike
not sure what else
Andrei Balmus
@abalmush
Hi guys, does anyone has experience with intergating Jest in canjs app?
Gregg Roemhildt
@roemhildtg
I've done this @abalmush
Jest works super well testing view models
Andrei Balmus
@abalmush
@roemhildtg do you have an example especially how to configure it
I have quite old project with canjs 2.3 )
Gregg Roemhildt
@roemhildtg
Weeeeelll, I haven't really needed to configure anything with Jest. That being said I'm writing stuff in es6 now so everything just works.
I'm also using canjs 5
Andrei Balmus
@abalmush
and I tried to get it to work, looks like the instance of canjs inside Component is differetn and I see warning somethig saying that this component is not registered
yeah with Canjs5 should work pretty well
Gregg Roemhildt
@roemhildtg
Ah, so you're trying to test the components? I haven't done that yet. Just viewModel testing so far. Like logic and whatnot. Functional testing is a whole new level for me
Andrei Balmus
@abalmush
yeah yea exatly I’m trying to render it using stache and check if everything is rendered. Same way as with React component )
Gregg Roemhildt
@roemhildtg
Yeah. Its on my todo list to look into that.
Andrei Balmus
@abalmush
Please let me know if you figure it out, I’ll post a message here as well
Gregg Roemhildt
@roemhildtg
:thumbsup:
Guido Smeets
@gsmeets
I am using mocha, but the principles are the same I reckon
I've made a few helper functions to easily render a component. The only tricky part is when you have fixtures for your data, which are collected async. So you need to add some promise to your viewmodels to ensure that they're loaded. I've done that generically for all my "functional" components.
Kevin Phillips
@phillipskevin
@abalmush can you post the error you're seeing?
Andrei Balmus
@abalmush
Hi @phillipskevin ok sure I will post it later, today.
Kevin Phillips
@phillipskevin
:thumbsup:
Andrei Balmus
@abalmush
I configured it from scratch, and I’m gettin another error:
Screen Shot 2018-09-15 at 11.09.21 PM.png
and this is the component it self
Screen Shot 2018-09-15 at 11.11.34 PM.png
that looks like something different, before it was that Jest didn’t see component initialization
I will try to reproduce later
Marc Godard
@MarcGodard
I have seen a way to do this, but cannot remember. I have a viewmodel variable that defaults to null, then gets set (this is a session type variable). Then in another viewmodel, once that is set, I want to update a variable, using get (). Just can't figure out how to do that anymore.
Any one know?
Andrei Balmus
@abalmush
@MarcGodard you can find a model of the component using can.viewModel - https://canjs.com/doc/can-view-model.html
Kevin Phillips
@phillipskevin
@abalmush are you using steal somewhere in your code?
Andrei Balmus
@abalmush
HI @phillipskevin nope, it comes from canjs package map/backup/backup
as per stack trace
if I creat component inside my test file no issues )
The only thing I do in my code is this: import ‘can/map/backup/backup’;
so I can backup my Map and restore it if needed
Kevin Phillips
@phillipskevin
ok, I'll take a look
oh, just because all can packages are using steal syntax in 2.x
Andrei Balmus
@abalmush
OK sure thank you. Btw this is old canjs 2.3