These are chat archives for reactioncommerce/reaction

31st
Oct 2015
Aaron Judd
@aaronjudd
Oct 31 2015 00:05
maybe this need to be explicit: api.use('reactioncommerce:core@0.9.4');?
Spencer Norman
@spencern
Oct 31 2015 00:08
tried that too, no different - still can’t find the factories
It still works fine if I run all tests from core and then run tests from my package
takes a little longer, but it’s a workaround I can deal with
and I can always comment out the tests in core if I need a speedup
QR
@ababba15
Oct 31 2015 00:09
@spencern hi from null-man
)
Spencer Norman
@spencern
Oct 31 2015 00:10
hi null@ababba1
QR
@ababba15
Oct 31 2015 00:10
hahah
Aaron Judd
@aaronjudd
Oct 31 2015 00:10
@spencern I wonder if that’s a build bug (from meteor tool) or our fault. I’ll dig into it some more as soon as I emerge from #510
Spencer Norman
@spencern
Oct 31 2015 00:11
Yeah, no rush at all. My guess is that the Package.onTest block is designed to not run unless that package is tested
which would mean that fakerand the Factories never actually get defined
Aaron Judd
@aaronjudd
Oct 31 2015 00:12
yes, makes sense… a flaw in my book, but ok...
Spencer Norman
@spencern
Oct 31 2015 00:12
So maybe it’s a 'feature'
but yeah, a pain
Aaron Judd
@aaronjudd
Oct 31 2015 00:12
you say feature, I saw flaw… that’s my problem right there.
Spencer Norman
@spencern
Oct 31 2015 00:13
well, it’s hugely annoying for me right now, so I’m down with labeling it as a bug
Just seems like test block isolation could be useful in some circumstances
@aaronjudd would it be helpful if I leave comments on #510 as to our needs and how we’ve been approaching inventory?
Aaron Judd
@aaronjudd
Oct 31 2015 00:14
yes, that’d be helpful
Aaron Judd
@aaronjudd
Oct 31 2015 00:21
btw - the reason I moved factories.. in Factory.define, the default shopId, userId went from Factory.get to thefaker.reaction functions.. Factory.get doesn’t return anything until Factory.create is ran, so while those where working before - it was because Factory.create never ran anywhere except in tests. The Factory.define started injecting shops fixture data before any of the other startup fixtures could run, (because the the faker.reaction functions aren't meteor functions and are executing immediately.) phew
Spencer Norman
@spencern
Oct 31 2015 00:23
ah, makes a lot of sense.
Aaron Judd
@aaronjudd
Oct 31 2015 00:23
so moving this into it’s own package should help, but I’ll still probably just need to export like we were before and wrap in a Meteor.startup to prevent early declaration, or do some refactoring to Faker (maybe work on the meteor faker package)
Spencer Norman
@spencern
Oct 31 2015 00:25
I moved from Factory.getto the faker.reaction functions because Factory.get was overflowing the stack every time I tried to create a Factory. Probably because of all the interconnectedness between Shops, Users, Etc, but we needed Factory data that had real users, carts, products, orders, etc that were connected
Aaron Judd
@aaronjudd
Oct 31 2015 00:27
I like using Faker for this purpose… so I have no objections (and we discussed making it for tests only before). the other side affect though was that it’s only testing a single shop now, while before we were testing multiple shops. I’ll need to look at the Factory implementation and see what we can do there (or maybe I’m wrong).
Spencer Norman
@spencern
Oct 31 2015 00:28
Yeah, that was probably my fault. I think it wouldn’t be too hard to make it test multiple shops though
Aaron Judd
@aaronjudd
Oct 31 2015 00:29
agreed. ok - let me get a package going now.
newsiberian
@newsiberian
Oct 31 2015 04:25
Hello, @aaronjudd or maybe someone else could answer? I don't get it. What is a purpose of "products/setHandleTag" collection method. I look at the code, I see the effect it does, but I can't understand, what its practical purpose? I mean, in which cases, people will use it?
Aaron Judd
@aaronjudd
Oct 31 2015 04:35
it sets the url of the product page.
Aaron Judd
@aaronjudd
Oct 31 2015 04:55
@spencern try: reactioncommerce:reaction-factories
Tony
@tonyrewin
Oct 31 2015 10:44
hello everybody, is there any examples of alternative workflow?