pegjs/spec/unit/compiler/passes/report-missing-rules.spec.js
David Majda e61c23c634 ESLint: Set environments better
Instead of setting ESLint environment to "node" globally, set it on
per-directory basis using separate .eslintrc.json files:

  Directory   Environment
  -----------------------
  bin         node
  lib         commonjs
  spec        jasmine

It was impossible to use this approach for the "benchmark" directory
which contains a mix of files used in various environments. For
benchmark/run, the environment is set inline. For the other files, as
well as spec/helpers.js, the globals are declared manually (it is
impossible to express how these files are used just by a list of
environments).

Fixes #408.
2016-01-29 14:50:38 +01:00

18 lines
456 B
JavaScript

/* global PEG */
"use strict";
describe("compiler pass |reportMissingRules|", function() {
var pass = PEG.compiler.passes.check.reportMissingRules;
it("reports missing rules", function() {
expect(pass).toReportError('start = missing', {
message: 'Referenced rule "missing" does not exist.',
location: {
start: { offset: 8, line: 1, column: 9 },
end: { offset: 15, line: 1, column: 16 }
}
});
});
});