A jest transform that enables nearley grammar support
-
Install the transform:
npm install jest-transform-nearley
-
Configure jest:
{ "transform": { "^.+\\.ne$": "jest-transform-nearley" } } -
Now you can import *.ne files from javascript:
const grammar = require('./grammar.ne');
Testing:
npm run testFormatting with prettier:
npm run formatMIT License
Inspired by: