Macha unit test uses-- growl parameter to report an error

beginner unit testing, using the mocha framework, report an error when using the-- growl parameter
there are two test methods, as follows:
add.js

function add(x, y) {
  return x + y;
}

module.exports = add;

multiply.js

function multiply(x, y) {
  return x * y;
}

module.exports = multiply;

two test suites, as follows:
add.test.js

var add = require("../src/add.js");
var expect = require("chai").expect;

describe("", function() {
  it("1  1  2", function() {
    expect(add(1, 1)).to.be.equal(2);
  });

  it("0", function() {
    expect(add(1, 0)).to.be.equal(1);
  });
});

multiply.test.js

var multiply = require("../../src/multiply");
var expect = require("chai").expect;

describe("", function() {
  it("1  1  1", function() {
    expect(multiply(1, 1)).to.be.equal(1);
  });
})

demo directory relationship, as shown below:

clipboard.png

:mocha --recursive --reporter tap --growl
:


:

clipboard.png

because of the first contact with unit testing, and also the first contact with the testing framework of mocha, I am not very good at mastering some things, and I can"t find a similar problem solution on the Internet. I also hope that the kind-hearted Daniel can help correct the mistake!

Mar.30,2021

because you don't have growl installed

Menu