onfido / jasmine-react-rails Goto Github PK
View Code? Open in Web Editor NEWUnit test your Rails React Components using Jasmine and Node.js
Unit test your Rails React Components using Jasmine and Node.js
Hi,
Sorry to bother with more questions, but what if I want to test a component that has children? I get an error saying the child component is not defined. For example I have a <Title/> component that has a component as a child, but has behavior that I want to test separately. Any suggestions? Thank you again!
I've gotten through all the setup, then ran grunt
just for a sanity check, but this is what I got:
$ grunt
Running "wrap:advanced" (wrap) task
Wrapped 0 files
Running "react:dynamic_mappings" (react) task
Running "execute:target" (execute) task
-> executing myapp/react_spec/run_tests.js
module.js:341
throw err;
^
Error: Cannot find module 'myapp/react_spec/support/compiled/components//modals/modal_ctrl'
at Function.Module._resolveFilename (module.js:339:15)
at internalRewire (myapp/react_spec/node_modules/rewire/lib/rewire.js:23:25)
at rewire (myapp/react_spec/node_modules/rewire/lib/index.js:11:12)
at Object.<anonymous> (myapp/react_spec/support/compiled/spec/modals/form_modal_ctrl_spec.js:6:27)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:20:19)
Warning: -> error 1 myapp/react_spec/run_tests.js (780ms) Use --force to continue.
Aborted due to warnings.
Could this have anything to do with the path 'myapp/react_spec/support/compiled/components//modals/modal_ctrl' having 2 slashes between components and modals? Any idea how I can fix this? Thank you!!
Hi, I am trying to test my React components and am getting an error that "Pusher is not defined." I am trying to either stub the Pusher variable ( the component in getInitialState calls pusher: new Pusher(app-key)), or require the Pusher library, with no success in either approach. Any suggestions? Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.