Tag: jsdom

npm在Windows上安装jsdom错误?

我在我的Windows PC上安装了nodejs。 它工作正常。 但是当我试图用“npm install jsdom”来安装jsdom时,我被这个错误提示了。 节点“C:\ Program Files \ nodejs \ node_modules \ npm \ bin \ node-gyp-bin \ …. \ node_modules \ node-gyp \ bin \ node-gyp.js”重build信息如果以ok 呃! 错误:Python似乎没有安装 在C:\ Program Files \ nodejs \ node_modules \ npm \ node_modules \下运行failNoPython(C:\ Program Files \ nodejs \ node_modules \ npm \ node_modules \ node-gyp […]

摩卡命令给ReferenceError:窗口没有定义

首先它不是重复的问题,因为我已经看过他们。 我正在使用下面的命令 mocha –compilers :./test/babel-setup.js –recursive –watch 给出下面的错误: ReferenceError: window is not defined 在babel-setup.js下面的代码在那里。 require("babel/register")({ compact: false }); 我使用节点0.12.7和“摩卡”:“^ 2.2.5”和“jsdom”:“^ 3.1.2”。 我错过了什么? 我已经安装了该项目的jsdom 。

在Windows 7 x64(NodeJS jQuery)下构build竞争对手

我试图让node-jquery工作。 contextify是依赖关系之一( jsdom需要)。 需要使用Python以某种方式构buildcontextify 。 但是,这似乎不适用于Windows 7 x64。 至less有一个我的电脑:) 经过一些阅读( #10 , #12 , #17 ),并尝试一些由这个叉提供的二进制文件,这一个我可以得到它的工作… 我从node-gyp configure或node-gyp rebuild ( npm install jquery )得到同样的错误: info it worked if it ends with ok info downloading: http://nodejs.org/dist/v0.6.14/node-v0.6.14.tar.gz info downloading: http://nodejs.org/dist/v0.6.14/x64/node.lib info downloading: http://nodejs.org/dist/v0.6.14/node.lib spawn python [ 'D:\\Users\\ngryman\\.node-gyp\\0.6.14\\tools\\gyp_addon', 'binding.gyp', '-ID:\\Users\\ngryman\\build\\config.gypi', '-f', 'msvs', '-G', 'msvs_version=2010' ] File "D:\Users\ngryman\.node-gyp\0.6.14\tools\gyp_addon", line […]

在基于jsdom的testing中调用setState导致“无法在工作线程中呈现标记”错误

我正在使用我自己的小型“虚拟浏览器”实用程序在jsdom下testing我的React组件。 工作得很好,直到我想setState 。 例如,当testing儿童年龄input控件时: describe('rendering according to the draft value', function () { var component; beforeEach(function () { component = TestUtils.renderIntoDocument( React.createElement(ChildrenInput, {value: []}) ); component.setState({draft: [{age: null}, {age: null}]}, done); }); it('overrides the value property for the count', function () { assert.strictEqual(component.refs.count.props.value, 2); }); it('overrides the value property for the ages', function () { […]

什么是jsdom的用例

看完这个微模板是死的文章。 我很好奇: 无论是在服务器上使用DOM,都会产生更清洁,更可维护的代码,然后模板化。 使用jsdom而不是模板引擎更高效。 如何将jsdom分解为标准MVC设置的视图。 通常在什么情况下最好使用服务器端的DOM抽象,比如jsdom,而不是像EJS或者jade这样的模板引擎。 这个问题是特定于node.js和其他SSJS