pegjs/test/unit/compiler/passes/report-undefined-rules.spec.js
David Majda 6817f3b964 Tests: Require specific modules instead of the whole library
Requiring the whole library was a relict from the time where the tests
were exercising the browser build when run in the browser.
2016-12-16 13:21:48 +01:00

22 lines
563 B
JavaScript

"use strict";
let chai = require("chai");
let helpers = require("./helpers");
let pass = require("../../../../lib/compiler/passes/report-undefined-rules");
chai.use(helpers);
let expect = chai.expect;
describe("compiler pass |reportUndefinedRules|", function() {
it("reports undefined rules", function() {
expect(pass).to.reportError("start = undefined", {
message: "Rule \"undefined\" is not defined.",
location: {
start: { offset: 8, line: 1, column: 9 },
end: { offset: 17, line: 1, column: 18 }
}
});
});
});