expect.js

    1热度

    1回答

    我正在写一些expect.js匹配器,我想测试自己的匹配器。所以我想写正面和负面的测试。假设我写了 toContainItem(name); 这样使用; expect(femaleNames).toContainItem('Brad'); // test fails expect(femaleNames).toContainItem('Angelina'); // test passes

    -1热度

    2回答

    我正忙于为我写的现有nodejs api构建功能测试。我正在使用摩卡和expect.js。 一个失败的测试是当我想对url参数的存在做一个负面测试时。我想要的是如果param丢失,则将消息发回服务的使用者。 目前正测试我的作品: var request = require('request'); it('get a specific user from the api', function (

    2热度

    1回答

    我正在使用酶,sinon,并期望单元测试我的反应组分。 import React from 'react'; import expect from 'expect.js'; import { shallow } from 'enzyme'; import ExampleComponent from './../../../src/js/components/example-componen

    0热度

    1回答

    我正在使用Node,Socket.IO和BDD创建一个聊天应用程序。在测试过程中的一个,我得到一个超时错误,指出: Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test. 受影响的试验 it('#must be able to receive a message', fu

    7热度

    1回答

    学习TDD和我的“Hello World”服务器响应的第一个简单测试在Mocha中失败。我正在使用Mocha.js,Superagent,& Expect.js。 当我curl -i localhost:8080,我得到正确的响应和状态代码。 HTTP/1.1 200 OK Content-Type: text/plain Date: Mon, 27 Apr 2015 17:55:36 GMT