These are chat archives for reactioncommerce/reaction

15th
Jul 2016
Brent Hoover
@zenweasel
Jul 15 2016 00:00
btw, protip. You can use describe.only to just run the one test you want to run rather than running the entire test suite
Spencer Norman
@spencern
Jul 15 2016 00:00
yeah, reading through mocha docs now :+1:
Brent Hoover
@zenweasel
Jul 15 2016 00:01
you can use only or skip on either describe or it
Spencer Norman
@spencern
Jul 15 2016 00:05
is ./reaction test the best way to run these btw?
Brent Hoover
@zenweasel
Jul 15 2016 00:05
That’s how I do it
Spencer Norman
@spencern
Jul 15 2016 00:06
cool, was hoping for native mocha or something faster that didn’t build the app, but I guess Meteor isn’t quite there
Brent Hoover
@zenweasel
Jul 15 2016 00:07
Actually, because these are “full-app” tests it will always have to build the app. When we start writing unit tests then you can avoid (some of) that
Spencer Norman
@spencern
Jul 15 2016 00:08
yeah, makes sense
Brent Hoover
@zenweasel
Jul 15 2016 00:08
These full-app tests are basically a native meteor analog to the Velocity stuff
and yes, it takes forever
Honestly these Stripe tests could be written as unit tests
but I was getting an error when trying to run the unit test runner so I just punted
Spencer Norman
@spencern
Jul 15 2016 00:10
fair, we’ve had trouble getting unit tests working as well, but we haven’t spent too much time on it
Brent Hoover
@zenweasel
Jul 15 2016 00:11
You have to build the app to run the other tests so, it;s only not a huge extra overhead for now. But yeah, the whole point of unit tests is that they run quickly
running the unit test runner now I don’t get any errors. Maybe I will play around with again later
Spencer Norman
@spencern
Jul 15 2016 00:12
is there a way to keep a meteor instance built and run tests without building/seeding app from scratch each time?
like a ‘watch’ functionality or similar
or does that defeat the purpose of the integration tests too
Brent Hoover
@zenweasel
Jul 15 2016 00:18
The watch will just rebuild on change, so it doesn’t really speed anything up
When we have unit tests, watch will make sense but for integration tests it was just an annoyance (for me)
Spencer Norman
@spencern
Jul 15 2016 00:19
:+1:
Brent Hoover
@zenweasel
Jul 15 2016 00:19
if you remove the —once flag, you are in watch mode. That’s the default
Spencer Norman
@spencern
Jul 15 2016 00:19
within ./reaction test?
oh, in the shell file
nm
Brent Hoover
@zenweasel
Jul 15 2016 00:20
Yeah, I will add these modes to the reaction-cli some time today
Spencer Norman
@spencern
Jul 15 2016 00:21
Do you know if this.skip() works in meteor?
https://mochajs.org/#inclusive-tests
Brent Hoover
@zenweasel
Jul 15 2016 00:22
I never tried it. It should though.
Why would you want to do that?
Spencer Norman
@spencern
Jul 15 2016 00:22
to programatically skip the tests if ENV isn’t defined
Brent Hoover
@zenweasel
Jul 15 2016 00:22
Oh, yeah. That’s a good idea
Spencer Norman
@spencern
Jul 15 2016 00:37
Doesn’t seem that this.skip() works as described in the mocha docs
hrath2015
@hrath2015
Jul 15 2016 03:27
@jshimko great stuff. :clap: It will be ultra easy now for folks esp windows users. I have not tried test option though. Will be doing it soon and revert.
Himanshu Aggarwal
@haggarwal90
Jul 15 2016 05:40
Hi . Any documentation for adding new schema to RC
?
Brent Hoover
@zenweasel
Jul 15 2016 05:40
You can just follow the SimpleSchema docs
We’re not really doing anything special there
Himanshu Aggarwal
@haggarwal90
Jul 15 2016 05:42
ok . reading it
i mean documentation for adding new collection to RC
Brent Hoover
@zenweasel
Jul 15 2016 05:45
I guess I don’t understand what you’re looking for. You can just create a schema and use it.
We have documentation on using the schemas we have defined. https://docs.reactioncommerce.com/reaction-docs/development/simple-schema
But you probably saw that already
Himanshu Aggarwal
@haggarwal90
Jul 15 2016 05:48

i want to create new Collection 'Offers' and then read data from 'Offers'.

i created new Offers schema and added to collection and schema package as well.

Then i did rc reset but still dont see the offers collection in DB. May be i missing something. No issue i m looking at this . i was just wondering if any step by step documentation for adding new collection

Brent Hoover
@zenweasel
Jul 15 2016 05:49
Typically Meteor won’t create a Collection until you actually use the collection
Himanshu Aggarwal
@haggarwal90
Jul 15 2016 05:50
ohhh. is it. may be that is the reason i dont see the collection. let me use it and see
Brent Hoover
@zenweasel
Jul 15 2016 05:50
Creating a schema doesn’t have anything necessarily to do with creating a collection
If you have it published somewhere that should do it
Himanshu Aggarwal
@haggarwal90
Jul 15 2016 07:33

@zenweasel now i can see Offer collection in db. now in Entry trigger i subscribed to my collection and then tried to fetch record but it shows blank array

but when i do same from browser console so it shows record even on with out any sign in . do u know where can be issue?

Brent Hoover
@zenweasel
Jul 15 2016 07:34
Possibly permission?
Himanshu Aggarwal
@haggarwal90
Jul 15 2016 07:34
which permission?
Brent Hoover
@zenweasel
Jul 15 2016 07:35
Well, normally you need to set allow/deny rules on a publication
does the subscription have any parameters?
Himanshu Aggarwal
@haggarwal90
Jul 15 2016 07:35
no
Brent Hoover
@zenweasel
Jul 15 2016 07:36
if you are getting it in the browser then it doesn’t seem like it’s permissions
not sure w/o looking at it then
Himanshu Aggarwal
@haggarwal90
Jul 15 2016 07:36
correct because i had same issue earlier as well and at that time it was permission issue
Brent Hoover
@zenweasel
Jul 15 2016 07:37
do you need to wait for the subscription? e.g. check that it’s ready()
i.e. it’s ready in the browser but not when you are trying to get it elsewhere
that’s probably it
Himanshu Aggarwal
@haggarwal90
Jul 15 2016 07:38
ok . trying it
Brent Hoover
@zenweasel
Jul 15 2016 07:38
you probably need to make it wait for ready and then grab the data
Himanshu Aggarwal
@haggarwal90
Jul 15 2016 12:26

Hi this question is about audit-argument-checkspackage

is there any check which allow String and Null both

i have a agrument which can be null or some string value

Brent Hoover
@zenweasel
Jul 15 2016 12:26
Yeah, you can use Match.oneOf(thisThing, thatThing)
Himanshu Aggarwal
@haggarwal90
Jul 15 2016 12:27
ohh cool thanks
Brent Hoover
@zenweasel
Jul 15 2016 12:27
:+1: