-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
require('spine') in mocha tests in node #1
Comments
Hi Jack, Thanks for the comment! This is admittedly a work in progress -- before I look closer did you check out the README? I'm not crazy about the way tests actually run in brunch and I do them a bit differently with this skeleton. Specifically:
So tests are all headless on this skeleton (that sounds really weird). I'll look at adding your change so they might work both ways but was curious if you tried tests my way |
Yes, I'm using your Makefile,
|
So I added your suggestion for pulling from To clarify with spine plugins like Ajax, it seems like you could use the same convention:
The deep link into the file system is not great... I wonder if the spine module could be changed to make this look nicer but I'm not quite sure. Maybe splitting up the library is more trouble than its worth? Also as I'm pretty new to spine, does simply requiring 'spine' bring in all of the plugins? |
I really like your choice of technologies in this repo but I'm unable to find a good way to test it using mocha. If you run this test in mocha in the nodejs runtime, Spine will not be defined. You can added
Spine = window?.Spine ? require('spine')
to the topapp/models/example_model
which will grab the global Spine in the browser and require the node_module spine in the nodejs runtime. However, this gets more complicated when you need Spine.Model.Ajax and Spine.Model.Relation.How you found a clean way to do this?
test/unit/example_model.coffee:
app/models/example_model.coffee:
The text was updated successfully, but these errors were encountered: