2016-07-29 15:16:56 +02:00
|
|
|
"use strict";
|
|
|
|
|
2016-12-08 08:59:04 +01:00
|
|
|
let chai = require("chai");
|
|
|
|
let helpers = require("./helpers");
|
2016-12-16 13:21:48 +01:00
|
|
|
let pass = require("../../../../lib/compiler/passes/report-undefined-rules");
|
2016-09-08 13:29:06 +02:00
|
|
|
|
2016-12-08 08:59:04 +01:00
|
|
|
chai.use(helpers);
|
|
|
|
|
|
|
|
let expect = chai.expect;
|
|
|
|
|
2016-07-29 15:16:56 +02:00
|
|
|
describe("compiler pass |reportUndefinedRules|", function() {
|
|
|
|
it("reports undefined rules", function() {
|
2016-12-08 08:59:04 +01:00
|
|
|
expect(pass).to.reportError("start = undefined", {
|
2016-09-22 05:25:09 +02:00
|
|
|
message: "Rule \"undefined\" is not defined.",
|
2016-07-29 15:16:56 +02:00
|
|
|
location: {
|
2016-09-22 05:25:09 +02:00
|
|
|
start: { offset: 8, line: 1, column: 9 },
|
|
|
|
end: { offset: 17, line: 1, column: 18 }
|
2016-07-29 15:16:56 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|