简体   繁体   English

测试javascript中异步加载的脚本的工具

[英]tool to test asynchronously loaded scripts in javascript

I'm giving my first steps with single wep page apps and RequireJs, and I noticed that quite often everything seems to work find locally, but when deployed on a remote server some errors appears at random, mainly because of async files being loaded and dependencies not being well defined. 我正在使用单个wep页面应用程序和RequireJs做我的第一步,我注意到很多时候似乎所有事情都可以在本地找到,但是当部署在远程服务器上时,随机会出现一些错误,这主要是由于异步文件正在加载和依赖定义不清。

(here's just an example https://groups.google.com/forum/#!topic/requirejs/skOZCi-3nFU/discussion ) (这只是一个示例https://groups.google.com/forum/#!topic/requirejs/skOZCi-3nFU/discussion

I was wondering if there is some kind of tool that could run automated tests but forcing every script to be delayed, trying all possible combinations (I was thinking about some kind of proxy)... 我想知道是否有某种工具可以运行自动化测试,但会强制每个脚本延迟,尝试所有可能的组合(我在考虑某种代理)...

If there's no such thing, how do you test these kind of scenarios? 如果没有这种事情,您如何测试这种情况?

Have you looked into boilerplatejs . 你有没有看过boilerplatejs This is a reference architecture which we are using with our single page java script applications. 这是我们与单页Java脚本应用程序一起使用的参考体系结构。 This will help you to manage your code in a more efficient manner. 这将帮助您以更有效的方式管理代码。 Have a look. 看一看。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 JavaScript:异步加载的脚本,是那些“并行”评估的(竞争条件)吗? - JavaScript: Asynchronously loaded scripts, are those evaluated “in parallel” (Race conditions)? 耦合/链接多个异步加载的JS脚本(JavaScript) - Coupling/chaining multiple asynchronously loaded JS scripts (JavaScript) Modernizr - 哪些脚本异步加载? - Modernizr - Which scripts get loaded asynchronously? 根据先前异步加载的JavaScript加载JavaScript - Load JavaScript depending on previously asynchronously loaded JavaScript 如何异步调试JavaScript? (许多脚本正在加载) - How to debug JavaScript asynchronously? (many scripts are loading) 异步加载的脚本会影响其他脚本的加载时间吗? - Does an asynchronously loaded script affect the loading time of other scripts? 为什么要异步加载Facebook Javascript SDK? - Why is Facebook Javascript SDK loaded asynchronously? JavaScript在Firefox 3中异步加载(根据Firebug)? - JavaScript being loaded asynchronously in Firefox 3 (according to Firebug)? HtmlAgilityPack下载通过javascript异步加载的网页 - HtmlAgilityPack download webpage which loaded asynchronously by javascript 为什么没有使用 javascript 加载脚本? - why scripts are not loaded in using javascript?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM