我不确定是否将 Travis-CI 用于我的客户端 JavaScript 库,因为它在 Travis-CI 服务器上使用 NodeJ 进行编译.
I'm not sure to use Travis-CI for my client-side JavaScript library or not, because it compiles with NodeJs on Travis-CI servers.
我想知道这是一种将某种持续集成(例如 Travis-CI)用于客户端库的好方法吗?
I want to know is this a good approach to use some kind of continuous integration such as Travis-CI for client-side libraries or not?
是的,当然你应该使用与客户端库的持续集成.
Yes of course you should use continous integration with client side libraries.
我个人使用 PhantomJS(无头 webkit 浏览器),即 已经安装在 Travis-CI 中.我认为这对于客户端的东西来说是比 NodeJs 更好的选择.
I personally use PhantomJS (headless webkit browser) which is already installed in Travis-CI. I think this is the better option for client-side stuff than NodeJs.
如果你使用 Grunt,它会变得更容易使用,你只需要一个简单的 Gruntfile.js 文件,您在浏览器中运行的测试(我使用 QUnit)和一个简单的 .travis.yml
If you use Grunt, it gets even easier to use, all you need is a simple Gruntfile.js file, your tests that run in browser (I use QUnit), and a simple .travis.yml
Gruntfile.js:
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
qunit: {
files: ['test/index.html']
}
});
// Load plugin
grunt.loadNpmTasks('grunt-contrib-qunit');
// Task to run tests
grunt.registerTask('test', 'qunit');
};
.travis.yml:
before_script:
- sudo npm install -g grunt
script: grunt test --verbose --force
您可以在我的一个项目中查看实际效果(GitHub 上的源代码).
You can see it in action at one of my projects (source on GitHub).
这篇关于将 Travis-CI 用于客户端 JavaScript 库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
检查一个多边形点是否在传单中的另一个内部Check if a polygon point is inside another in leaflet(检查一个多边形点是否在传单中的另一个内部)
更改传单标记群集图标颜色,继承其余默认 CSSChanging leaflet markercluster icon color, inheriting the rest of the default CSS properties(更改传单标记群集图标颜色,继承其余默认
触发点击传单标记Trigger click on leaflet marker(触发点击传单标记)
如何更改 LeafletJS 中的默认加载磁贴颜色?How can I change the default loading tile color in LeafletJS?(如何更改 LeafletJS 中的默认加载磁贴颜色?)
将 Leaflet 图层控件添加到侧边栏Adding Leaflet layer control to sidebar(将 Leaflet 图层控件添加到侧边栏)
Leaflet - 在弹出窗口中获取标记的纬度和经度Leaflet - get latitude and longitude of a marker inside a pop-up(Leaflet - 在弹出窗口中获取标记的纬度和经度)