We have been stalled on ESLint 3.8.0 for some time. Current ESLint is 3.13.0. We have been unable to upgrade because of more aggressive reporting on some rules, including indentation. ESLint configuration options and bugfixes are now such that we can reasonably upgrade. PR-URL: https://github.com/nodejs/node/pull/10561 Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
62 lines
2.1 KiB
JavaScript
62 lines
2.1 KiB
JavaScript
/**
|
|
* @fileoverview Helpers to test EventGenerator interface.
|
|
* @author Toru Nagashima
|
|
*/
|
|
"use strict";
|
|
|
|
/* global describe, it */
|
|
|
|
//------------------------------------------------------------------------------
|
|
// Requirements
|
|
//------------------------------------------------------------------------------
|
|
|
|
const assert = require("assert");
|
|
|
|
//------------------------------------------------------------------------------
|
|
// Public Interface
|
|
//------------------------------------------------------------------------------
|
|
|
|
module.exports = {
|
|
|
|
/**
|
|
* Overrideable `describe` function to test.
|
|
* @param {string} text - A description.
|
|
* @param {Function} method - A test logic.
|
|
* @returns {any} The returned value with the test logic.
|
|
*/
|
|
describe: (typeof describe === "function") ? describe : /* istanbul ignore next */ function(text, method) {
|
|
return method.apply(this);
|
|
},
|
|
|
|
/**
|
|
* Overrideable `it` function to test.
|
|
* @param {string} text - A description.
|
|
* @param {Function} method - A test logic.
|
|
* @returns {any} The returned value with the test logic.
|
|
*/
|
|
it: (typeof it === "function") ? it : /* istanbul ignore next */ function(text, method) {
|
|
return method.apply(this);
|
|
},
|
|
|
|
/**
|
|
* Does some tests to check a given object implements the EventGenerator interface.
|
|
* @param {Object} instance - An object to check.
|
|
* @returns {void}
|
|
*/
|
|
testEventGeneratorInterface(instance) {
|
|
this.describe("should implement EventGenerator interface", () => {
|
|
this.it("should have `emitter` property.", () => {
|
|
assert.equal(typeof instance.emitter, "object");
|
|
assert.equal(typeof instance.emitter.emit, "function");
|
|
});
|
|
|
|
this.it("should have `enterNode` property.", () => {
|
|
assert.equal(typeof instance.enterNode, "function");
|
|
});
|
|
|
|
this.it("should have `leaveNode` property.", () => {
|
|
assert.equal(typeof instance.leaveNode, "function");
|
|
});
|
|
});
|
|
}
|
|
};
|