8b7bff7ac3
This also temporarliy disables linting '.ts' files due to the fact that the currect '.d.ts' files contain too many errors/warnings that need to be manually fixed, but since I'm going to be rewriting the whole module in TypeScript anyway, resolving these ESLint error's is a pointless waste of time.
29 lines
715 B
JavaScript
29 lines
715 B
JavaScript
"use strict";
|
|
|
|
const chai = require( "chai" );
|
|
const helpers = require( "./helpers" );
|
|
const pass = require( "pegjs" ).compiler.passes.check.reportDuplicateRules;
|
|
|
|
chai.use( helpers );
|
|
|
|
const expect = chai.expect;
|
|
|
|
describe( "compiler pass |reportDuplicateRules|", function () {
|
|
|
|
it( "reports duplicate rules", function () {
|
|
|
|
expect( pass ).to.reportError( [
|
|
"start = 'a'",
|
|
"start = 'b'",
|
|
].join( "\n" ), {
|
|
message: "Rule \"start\" is already defined at line 1, column 1.",
|
|
location: {
|
|
start: { offset: 12, line: 2, column: 1 },
|
|
end: { offset: 23, line: 2, column: 12 },
|
|
},
|
|
} );
|
|
|
|
} );
|
|
|
|
} );
|