我正在編寫量角器測試套件,並且需要測試一些使用從另一個套件生成的頁面的東西。我只能想出編寫測試的一種方式,但它似乎是一個好辦法不寫它: var someStuffToSave = [];
describe('description of first thing', function(){
it('should generate some things', function(){
我使用茉莉節點做單元測試。我做了下面的代碼嘲諷Date.now() spyOn(Date, 'now').andReturn(1387636363717); //always return a fixed time
然後我試圖運行jasmine-node spec/,但它停止,沒有輸出工作。我無法弄清楚是什麼原因。
我試圖在我的Mongoose模型上測試自定義方法,但在測試模型中設置的值消失並使測試失敗。該測試是這樣的: it('should get the friend id', function(){
var conversation = new Conversation({
'users': [new ObjectId('0'), new ObjectId('1')]
}