进行摩卡测试?

我有一个基本测试,只是比较 2 个数字,但我无法让它运行。谁能向我解释为什么以及如何解决这个问题?


杰森


{  "scripts": {

  "test": "mocha test/**/*.js"

},

  "name": "image-gallery",

  "version": "1.0.0",

  "description": "",

  "main": "script-test.js",

  "directories": {

    "test": "script-test.js"

  },

 

  "author": "",

  "license": "ISC"

}

测试.js


const assert = require('assert');


describe('number test', function() {

    it('matching numbers', function() {

      assert.ok(2 === 2);

    });

  });


牛魔王的故事
浏览 52回答 1
1回答

慕后森

你是通过在项目目录中运行它来安装摩卡的吗?npm install --save-dev mocha
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript