These are chat archives for canjs/canjs

18th
Aug 2016
JigneshVasoya3292
@JigneshVasoya3292
Aug 18 2016 10:06
Hi ,
I'm facing an issue while setting attributes on a can.Map, : http://jsbin.com/leweyefeza/edit?html,js,console,output Can anyone please help me figuring out what I might be doing wrong? @imjoshdean @akagomez
Aslo, there's one more similar issue : http://jsbin.com/wovicujeme/edit?html,js,console,output
Christopher Oliphant
@RALifeCoach
Aug 18 2016 11:24
Hello All
I am attempting to run CanJS/StealJS unit tests using Karma and Jasmine
I can see steal load and I can see it load all the node_modules
I am using karma-steal-npm is anyone familiar with this?
Julian
@pYr0x
Aug 18 2016 12:59
@JigneshVasoya3292 what is the problem?
JigneshVasoya3292
@JigneshVasoya3292
Aug 18 2016 13:02
The issue is the way obj is getting ipdated with obj.attr({'someattr': attrvalue}) & obj.attr('someattr', attrvalue).
If you clook at Jsbin, you can see the issue.
Btw which JSbin you're referring to?
Julian
@pYr0x
Aug 18 2016 13:02
the frist one
sorry cant follow, waht is the problem?
map.attr(key, value)
map.attr(obj[, removeOthers])
Assigns each value in obj to a property on this can.Map named after the corresponding key in obj, effectively merging obj into the Map.
JigneshVasoya3292
@JigneshVasoya3292
Aug 18 2016 13:05
Yes, you're right, but while merging, if the updated list has lesser value than exsiting list, then it should be removed. The old value is staying in this case.
Julian
@pYr0x
Aug 18 2016 13:05
i dont think merging mean "deep merging"
JigneshVasoya3292
@JigneshVasoya3292
Aug 18 2016 13:06
If I pass plain object to .attr(), removed values stays , while if I use .attr(key, value'), the object getts overwritten
is that what u prefer?
JigneshVasoya3292
@JigneshVasoya3292
Aug 18 2016 13:08
Yes, But in my case , I blindly pass the plain object, i.e my object ahs multiple attributes, so I don't want to use 'remove' flag as true for all.
Julian
@pYr0x
Aug 18 2016 13:11
so what do you want instead?
JigneshVasoya3292
@JigneshVasoya3292
Aug 18 2016 13:12
While merging it should give the same result as setting to true, in my case (when udpated list has less values than original ).
Should merging remove the attributes when obj is merged with updated obj?
Julian
@pYr0x
Aug 18 2016 13:13
and why do you cant use true
i dont understand
JigneshVasoya3292
@JigneshVasoya3292
Aug 18 2016 13:15
That's one solution, I understand taht.
But my doubt is , whether the current implementation has a flaw or Am I misunderstanding it?
'Should merging remove the attributes when obj is merged with updated obj?'
This is my doubt
Christopher Oliphant
@RALifeCoach
Aug 18 2016 13:39
@phillipskevin Are you around to assist with a karma question?
Kevin Phillips
@phillipskevin
Aug 18 2016 13:40
sure
if I can :smile:
Christopher Oliphant
@RALifeCoach
Aug 18 2016 13:40
It is trying to load /base/541225d08418bb4185e186840ac3f6c72470ff3e/541225d08418bb4185e186840ac3f6c72470ff3e.js
I have no idea what that file is. I was hoping you might know
Kevin Phillips
@phillipskevin
Aug 18 2016 13:41
hmm, no idea
Christopher Oliphant
@RALifeCoach
Aug 18 2016 13:41
and running it against 3.0 and steal 1.0
okay - thanks
Kevin Phillips
@phillipskevin
Aug 18 2016 13:42
can you open the debugger and look at the sources?
Christopher Oliphant
@RALifeCoach
Aug 18 2016 13:42
yes - which source would you like me to open?
Kevin Phillips
@phillipskevin
Aug 18 2016 13:43
I assume that folder doesn’t exist?
Christopher Oliphant
@RALifeCoach
Aug 18 2016 13:44
no it does not
Kevin Phillips
@phillipskevin
Aug 18 2016 13:45
ok
I can’t really guess what would cause that without seeing the project
can’t think of anything off the top of my head
Christopher Oliphant
@RALifeCoach
Aug 18 2016 13:45
I’ll create a stripped down version on my code and see if it continues to happen
Kevin Phillips
@phillipskevin
Aug 18 2016 13:46
sounds good
Christopher Oliphant
@RALifeCoach
Aug 18 2016 13:46
If it does then I’ll store it on github
then you can have a look at the project
Kevin Phillips
@phillipskevin
Aug 18 2016 13:50
:thumbsup:
Christopher Oliphant
@RALifeCoach
Aug 18 2016 15:36
@phillipskevin The code is available now.
It is the same code I used when working with Justin on another issue.
To run the tests run: grunt karma-canjs
If I run tests/test.html in the browser, the test runs successfully
Kevin Phillips
@phillipskevin
Aug 18 2016 15:51
ok, I will take a look later today
busy with some other stuff so it will be a few hours probably
Christopher Oliphant
@RALifeCoach
Aug 18 2016 15:51
Thank-you
Kevin Phillips
@phillipskevin
Aug 18 2016 23:03
@RALifeCoach I finally got back to trying this and I can’t get the grunt task to run Warning: EMFILE: too many open files, scandir ‘/path/to/project/for-justin/node_modules’
I tried increasing the ulimit but no luck
Christopher Oliphant
@RALifeCoach
Aug 18 2016 23:04
I increased to 65535 files before it would work
Kevin Phillips
@phillipskevin
Aug 18 2016 23:04
ok
i’ll try that
Christopher Oliphant
@RALifeCoach
Aug 18 2016 23:05
Who is reading all those files? Is that glob or steal? Or some other code?
Kevin Phillips
@phillipskevin
Aug 18 2016 23:07
I’m not sure… I would guess karma
if I comment out some of the glob patterns in the karma conf the error goes away
it might be steal also… reading all of the package.jsons
Christopher Oliphant
@RALifeCoach
Aug 18 2016 23:10
I was thinking steal as well, because it often errors on package.json files