diff --git a/espree.js b/espree.js index dcc60c3a..d8069528 100644 --- a/espree.js +++ b/espree.js @@ -172,6 +172,6 @@ exports.VisitorKeys = (function() { return require("eslint-visitor-keys").KEYS; }()); -exports.getLatestEcmaVersion = getLatestEcmaVersion; +exports.latestEcmaVersion = getLatestEcmaVersion(); -exports.getSupportedEcmaVersions = getSupportedEcmaVersions; +exports.supportedEcmaVersions = getSupportedEcmaVersions(); diff --git a/tests/lib/supported-ecmaversions.js b/tests/lib/supported-ecmaversions.js index bdcd6c06..650a93f0 100644 --- a/tests/lib/supported-ecmaversions.js +++ b/tests/lib/supported-ecmaversions.js @@ -18,23 +18,15 @@ const assert = require("assert"), describe("getLatestEcmaVersion()", () => { it("should return the latest supported ecmaVersion", () => { - assert.strictEqual(espree.getLatestEcmaVersion(), 11); + assert.strictEqual(espree.latestEcmaVersion, 11); }); }); describe("getSupportedEcmaVersions()", () => { it("should return an array of all supported versions", () => { assert.deepStrictEqual( - espree.getSupportedEcmaVersions(), + espree.supportedEcmaVersions, [3, 5, 6, 7, 8, 9, 10, 11] ); }); - - it("the array of supported versions should not be mutable by reference", () => { - const supportedVersions = espree.getSupportedEcmaVersions(); - const originalValue = [...supportedVersions]; - - supportedVersions.push("a", "b", "c"); - assert.deepStrictEqual(espree.getSupportedEcmaVersions(), originalValue); - }); });