Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 06 18:40
    cherifGsoul review_requested #5441
  • Dec 06 18:39
    cherifGsoul opened #5441
  • Dec 06 18:22

    cherifGsoul on update-infrastructure-page

    Update infrastructure page with… (compare)

  • Dec 06 18:14
    greenkeeper[bot] commented #5422
  • Dec 06 18:14

    greenkeeper[bot] on @feathersjs

    chore(package): update @feather… (compare)

  • Dec 06 18:11
    greenkeeper[bot] commented #5401
  • Dec 06 18:11

    greenkeeper[bot] on @feathersjs

    chore(package): update @feather… (compare)

  • Dec 04 22:03
    chasenlehara opened #5440
  • Dec 04 22:03
    chasenlehara labeled #5440
  • Dec 04 19:18
    cherifGsoul review_requested #5432
  • Dec 04 14:09
    m-ahmadi starred canjs/canjs
  • Dec 04 10:52
    ansyeow starred canjs/canjs
  • Dec 03 14:53
    matthewp commented #5439
  • Dec 03 14:30
    frank-dspeed opened #5439
  • Dec 02 18:13
    greenkeeper[bot] commented #5392
  • Dec 02 18:13

    greenkeeper[bot] on core-js-3.4.7

    chore(package): update core-js … (compare)

  • Dec 02 17:48
    greenkeeper[bot] commented #5392
  • Dec 02 17:48

    greenkeeper[bot] on core-js-3.4.6

    chore(package): update core-js … (compare)

  • Dec 02 15:38
    phillipskevin commented #5438
  • Dec 02 15:38
    phillipskevin closed #5438
Andrei Balmus
@abalmush
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
yeah
Kevin Phillips
@phillipskevin
I'm not sure exactly how to configure Jest to work with this global variable
I'm sure someone has done it hough
Andrei Balmus
@abalmush
Yeah, I will return back to this issue and try to resolve it some urgent stuff popped up and I have to postpone it.
Kevin Phillips
@phillipskevin
ok
@MarcGodard you would do something like this
// parent-view-model.js
ViewModel: {
    sessionPromise: {
        default() {
            return Session.get({});
        }
    }
}
// child-view-model.js
ViewModel: {
    sessionPromise: "any",

    session: {
        get(lastSet, resolve) {
            if (this.sessionPromise) {
                this.sessionPromise.then(resolve);
            }
        }
    }
}
Kevin Phillips
@phillipskevin
and then pass the sessionPromise from the parent to the child through a binding
Marc Godard
@MarcGodard
@phillipskevin Thanks, thats what I was looking for
Kevin Phillips
@phillipskevin
:thumbsup:
Andrei Balmus
@abalmush
Hah, I completely misunderstood the question :) sorry
Justin Meyer
@justinbmeyer
Justin Meyer
@justinbmeyer
@/all I need some epic bike-shedding on: canjs/canjs#4472
Kevin Phillips
@phillipskevin
More sections of the Testing Guide have been published: https://canjs.com/doc/guides/testing.html
It now includes:
Testing Components (which was published last week but I don't think I announced)
Testing Routing
Viktor Busko
@Lighttree
events: {
        '.showMore enter': function (...args) {
            console.log('enter', args);
        },

        '.showMore click': function (...args) {
            console.log('click', args);
        }
    }
In this example Enter key press calls click as well. Is there way to avoid this ? Isn't this a bug ?
Jeroen Cornelissen
@jeroencornelissen
@Lighttree I think that’s just browser behaviour. If a <button> is focused you can press enter or space key and that will trigger the click event.
Do you need the .showMore enter event?
Viktor Busko
@Lighttree

yeah this obvious, I was thinking that this "special" enter event split internally mouse click and keyboard enter event.

Do you need the .showMore enter event?

Yes, I need slightly different behavior depends user use keyboard or mouse.