Fix plugin test that replaces parser

This test broke down aftert I intergrated the AST utils directly into the Grammar class, then I had problems importing the PEG.js parser to use the Grammar class, but found a workaround using 'process.cwd()'
master
Futago-za Ryuu 6 years ago
parent b0a5db1ab9
commit 4b6ceb2b46

@ -102,19 +102,20 @@ describe( "plugin API", function () {
config.parser = peg.generate( ` config.parser = peg.generate( `
{
const pp = require( process.cwd() + "/lib/peg" ).parser;
}
start = .* { start = .* {
return { return new pp.Grammar( void 0, [{
type: 'grammar', type: "rule",
rules: [{ name: "start",
type: 'rule',
name: 'start',
expression: { expression: {
type: 'literal', type: "literal",
value: text(), value: text(),
ignoreCase: false ignoreCase: false
} }
}] }] );
};
} }
` ); ` );

Loading…
Cancel
Save