开发者

Jasmine: define separate source file sets for Rails?

开发者 https://www.devze.com 2023-03-18 20:43 出处:网络
Separate parts of my site have separate sets of Javascript files, which -thrown all together- interfere with each other. In order to test everything with Jasmine, 开发者_如何转开发it seems I need some

Separate parts of my site have separate sets of Javascript files, which -thrown all together- interfere with each other. In order to test everything with Jasmine, 开发者_如何转开发it seems I need some way to define separate sets of "assets" for different suites. Is this currently possible and if so, how?


You may want to consider, as suggested, breaking your javascript into different namespaces. One great way to make it easy to separate javascript into multiple files is by using the module pattern which uses closures and a few other neat properties of javascript to execute necessary code immediately, and contain it.

0

精彩评论

暂无评论...
验证码 换一张
取 消