[英]Cannot find module 'it' when testing with mocha/chai
我有一個簡單的測試
import {topNavigationLinks} from './navigation-links.js';
import {assert,should,expect=} from 'chai';
import {mocha} from 'mocha';
describe('Navigation Links', () => {
it('should have the right value', function () {
expect(topNavigationLinks(123).to.equal([]));
});
});
但我不斷收到這個錯誤
Error: Cannot find module 'it'
有什么線索嗎?
錯誤是將node_modules作為我的Mocha腳本的一部分。 因此,它遍歷了所有的node_modules,顯然沒有找到it語句。 刪除那照顧它
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.