2016-12-08 10:05:17 +01:00
|
|
|
PEG.js Test Suite
|
2012-02-27 19:59:54 +01:00
|
|
|
=================
|
|
|
|
|
2016-12-08 10:05:17 +01:00
|
|
|
This is the PEG.js test suite. It ensures PEG.js works correctly. All tests
|
2012-02-27 19:59:54 +01:00
|
|
|
should always pass on all supported platforms.
|
|
|
|
|
2014-05-09 15:04:56 +02:00
|
|
|
Running in Node.js
|
|
|
|
------------------
|
2012-02-27 19:59:54 +01:00
|
|
|
|
2014-05-09 15:04:56 +02:00
|
|
|
All commands in the following steps need to be executed in PEG.js root directory
|
|
|
|
(one level up from this one).
|
2012-02-27 19:59:54 +01:00
|
|
|
|
2014-05-09 15:04:56 +02:00
|
|
|
1. Install all PEG.js dependencies, including development ones:
|
2012-02-27 19:59:54 +01:00
|
|
|
|
2016-05-05 10:15:28 +02:00
|
|
|
```console
|
|
|
|
$ npm install
|
|
|
|
```
|
2012-11-10 14:21:14 +01:00
|
|
|
|
2016-12-08 10:05:17 +01:00
|
|
|
2. Execute the test suite:
|
2012-11-10 14:21:14 +01:00
|
|
|
|
2016-05-05 10:15:28 +02:00
|
|
|
```console
|
2016-12-08 10:05:17 +01:00
|
|
|
$ gulp test
|
2016-05-05 10:15:28 +02:00
|
|
|
```
|
2012-11-10 14:21:14 +01:00
|
|
|
|
2016-12-08 10:05:17 +01:00
|
|
|
3. Watch the tests pass (or fail).
|
2012-02-27 19:59:54 +01:00
|
|
|
|
2014-05-10 16:40:39 +02:00
|
|
|
Running in the Browser
|
2014-05-09 15:04:56 +02:00
|
|
|
----------------------
|
2012-02-27 19:59:54 +01:00
|
|
|
|
2014-05-09 15:04:56 +02:00
|
|
|
All commands in the following steps need to be executed in PEG.js root directory
|
|
|
|
(one level up from this one).
|
2012-02-27 19:59:54 +01:00
|
|
|
|
2016-05-05 17:35:40 +02:00
|
|
|
1. Make sure you have Node.js installed.
|
2012-02-27 19:59:54 +01:00
|
|
|
|
2014-05-09 15:04:56 +02:00
|
|
|
2. Install all PEG.js dependencies, including development ones:
|
2012-02-27 19:59:54 +01:00
|
|
|
|
2016-05-05 10:15:28 +02:00
|
|
|
```console
|
|
|
|
$ npm install
|
|
|
|
```
|
2012-02-27 19:59:54 +01:00
|
|
|
|
2016-12-08 10:05:17 +01:00
|
|
|
3. Serve the test suite using a web server:
|
2012-02-27 19:59:54 +01:00
|
|
|
|
2016-05-05 10:15:28 +02:00
|
|
|
```console
|
2016-12-08 10:05:17 +01:00
|
|
|
$ test/server
|
2016-05-05 10:15:28 +02:00
|
|
|
```
|
2012-02-27 19:59:54 +01:00
|
|
|
|
2016-12-08 10:05:17 +01:00
|
|
|
4. Point your browser to the [test suite](http://localhost:8000/).
|
2014-05-09 15:04:56 +02:00
|
|
|
|
2016-12-08 10:05:17 +01:00
|
|
|
5. Watch the tests pass (or fail).
|