摘要: Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks. Spies should be created in test setup, before expectations. They can then be checked, using the standard Jasmine expectation syntax. Spies can be checked if they were called or not and what the c
阅读全文
摘要: 安装node.js安装依赖包sudo apt-get install g++ curl libssl-dev apache2-utilssudo apt-get install git-core获取node源码git clone git://github.com/joyent/node.git 下载完成之后进入cd node 进入node文件夹。指定迁出版本:git checkout v0.4.10 ,git是一个版本管理工具,这个我们用git迁出0.4.10版本,如果不迁出的话直接进行编译安装将会安装node最新版0.5.5-pre。最新版对很多常用的包是不支持的。比如express,所以这
阅读全文
摘要: The Chrome Developer Tools is really a power tool for web developer. My favorate feature is the element inspection, with this, you can pick some element from the browser, and the developer tool will be brought up and the corresponding element will be highlight in the Elements panel. Defaultly, you c
阅读全文
摘要: Source:http://en.wikipedia.org/wiki/Apache_AntApache Antis a software tool forautomating software buildprocesses. It is similar toMakebut is implemented using theJavalanguage, requires the Java platform, and is best suited to building Java projects.The most immediately noticeable difference between
阅读全文
摘要: var names = ['Hello', 'World'];for(var index in names) console.log(names[index]);这里的for each是遍历key-value pair。
阅读全文
摘要: 1Suites and specs1.1SpecsEach spec is, naturally, a JavaScript function. You tell Jasmine about a spec with a call to it() with a description string and the function. The string is a description of a behavior that you want your production code to exhibit; it should be meaningful to you when reading
阅读全文
摘要: IntroductionConfiguration file is written in YAML and is used to tell the test runner which files to load to browser and in which order. By default the JsTestDriver looks for the configuration file in the current directory and with the name jsTestDriver.conf. You can use --config command line option
阅读全文
摘要: There are some great JavaScript testing frameworks out there already, so why did we write another?None of the existing frameworks quite worked the way we wanted. Many only work from within a browser. Most don't support testing asynchronous code like event callbacks. Some have syntax that's h
阅读全文
摘要: With any program design it is important to use a programming convention when writing code. This not only helps the code look consistent (and one hopes avoids certain bugs), but also allows different programmers to work on the same code.The Alt Framework is no exception, so I hope to outline the conv
阅读全文
摘要: MyEclipse安装完成之后,有一个很常用的快捷键Content Assist(即代码提示)被默认为Ctrl + Space。这会使得我们使用中文操作系统的计算机用起来很不方便,因为我们平时打字必用的切换打字法的快捷键,恰恰就是这个!当然,你可以直接在Windows => Preferences... => General => Keys去替换掉这个快捷键,不过可能还会有其他快捷键与我们的中文操作系统有冲突。这里介绍一个一劳永逸,也是更“Eclipse化”的方法来改变这种尴尬局面:在MyEclipse的启动选项中,其实有Duser.language这样一项设置,在MyEcl
阅读全文