From 4b6ceb2b46306a6425d42b30e3b71607b8d8c519 Mon Sep 17 00:00:00 2001 From: Futago-za Ryuu Date: Fri, 26 Jan 2018 09:33:13 +0000 Subject: [PATCH] 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()' --- test/spec/api/plugin-api.spec.js | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/test/spec/api/plugin-api.spec.js b/test/spec/api/plugin-api.spec.js index 8b60e09..84b819d 100644 --- a/test/spec/api/plugin-api.spec.js +++ b/test/spec/api/plugin-api.spec.js @@ -102,19 +102,20 @@ describe( "plugin API", function () { config.parser = peg.generate( ` + { + const pp = require( process.cwd() + "/lib/peg" ).parser; + } + start = .* { - return { - type: 'grammar', - rules: [{ - type: 'rule', - name: 'start', - expression: { - type: 'literal', - value: text(), - ignoreCase: false - } - }] - }; + return new pp.Grammar( void 0, [{ + type: "rule", + name: "start", + expression: { + type: "literal", + value: text(), + ignoreCase: false + } + }] ); } ` );