Tag: testem

在Ubuntu上使用节点缓慢的静态文件服务

我们使用Testem来提供一堆HTML文件(模板)。 Testem使用Express的“res.sendfile”方法将静态文件发送回客户端。 在Mac机器上,速度非常快 – 根据Chromenetworking跟踪,每个文件需要1-2毫秒。 但是,在Ubuntu机器上,需要39ms。 这是最新的稳定节点 – 0.10.29。 Testem正在使用Express 3.1。 有什么build议可能会导致这种情况,或者我如何进一步诊断?

来自phantomJS的POST调用不会使服务器从咕噜声中运行

这是我的设置。 我有一个咕task任务,做2件事情:1)启动一个HTTP服务器监听某个端口2)触发另一个咕task任务 上面触发的grunt任务是在PhantomJS的test-index.html页面上运行testing的testem任务。 test-index.html页面在第一个grunt任务中启动服务器的端口上发送一个POST调用。 问题:POST调用不会打到我的服务器。 注意:如果我手动运行同一个服务器(不是从grunt)然后运行testinggrunt任务,POST调用命中服务器。 这里是代码: 咕task任务 grunt.registerMultiTask('coverage', 'Generates coverage reports for JS using Istanbul', function () { var server = http.createServer(function(req, resp) { resp.setHeader("Access-Control-Allow-Origin", "*"); console.log('Got something'); req.pipe(fs.createWriteStream('coverage.json')) resp.end(); }); var port = 7358; server.listen(port); // This task simply executes a command: `testem.js ci` grunt.task.run('testem').then(function() { server.close(); }); }); test-index.html(在某处) function onTestemLoad() { […]

如何在浏览器中运行茉莉花节点testing(例如使用testem)?

如何在浏览器中使用testem( https://github.com/testem/testem )运行jasmine-node( https://github.com/mhevery/jasmine-node )testing? 他们都在nodeJS上运行,但我不知道如何将它们结合起来。 我想知道是否有任何我可以使用的库,或者是否有人成功定制了两个库来在浏览器中loggingtesting输出。