This commit ensures that all modules outside 'lib' are importing 'lib/peg.js' so that VS Code automatically gets 'lib/peg.d.ts'.
An alias module for 'lib/peg.js' called 'pegjs-dev' was made for test files at 'test/node_modules/pegjs-dev.js'
- Moved benchmark to test/benchmark
- Moved tests to test/spec
- Removed individual servers
- Implemented single test server
- Moved server assets to test/server
- Updated Gulpfile.js
- Moved tools/impact to test/impact
This commit move's nearly all code related to testing the PEG.js module into the test directory, and also ensures they run as they did before the move.
The core of the transition is getting rid of Makefile and replacing it
with gulpfile.js. The rest is details (fixing dependencies, changing all
references to "make", etc.).
Target/task names mostly stay the same, so in most cases "gulp foo" does
what "make foo" did before. The only exceptions are "make browser" and
"make browserclean", which are now "gulp browser:build" and "gulp
browser:clean" (it feels more systematic).
Functionality is mostly unchanged (modulo Gulp clutter in the console),
but there are two small exceptions:
The reporter now displays just dots while previously it displayed
spec descriptions. There is also a deprecation warning (most likely
because I used an old version of gulp-jasmine in order to support
Jasmine 1.x). I kept these issues unfixed because I plan to switch
to Mocha soon (#409).
The copyright header is now added manually both to the development
and minified build. Before, it was added only to the development
build and the minified build relied on preserving it using "uglify
--comments". This was broken since switching to //-style comments.
There is now also an empty line between the header and the source
This will allow to use ES2015 constructs in spec code.
The change required introducing a small server, which serves both PEG.js
and spec code passed through Babel and bundled together. This allowed to
convert the specs to regular modules and get rid of the hackery that was
previously needed to make them run both in Node.js and in the browser.
Note the specs no longer exercise the browser version. This will allow
to spec PEG.js internals in the future.
* Moving the source code from /src to /lib.
* Adding an explicit file list to package.json
* Updating the Makefile.
* Updating the spec and benchmark suites and their READMEs.
Part of a fix for GH-32.
This is the first of many commits that gradually convert PEG.js's test
suite from QUnit to Jasmine, cleaning it up on the way.
Main reason for the change is that Jasmine allows nested contexts,
allowing to structure the tests in a better way than QUnit. Moreover,
the tests needed to be cleaned up a bit.