diff --git a/Makefile b/Makefile
index 9c8d89b..6f9840a 100644
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,8 @@ PARSER_OUT_FILE_NEW = $(LIB_DIR)/parser.js.new
BROWSER_FILE_DEV = $(BROWSER_DIR)/peg-$(PEGJS_VERSION).js
BROWSER_FILE_MIN = $(BROWSER_DIR)/peg-$(PEGJS_VERSION).min.js
+SPEC_SERVER_FILE = $(SPEC_DIR)/server
+
VERSION_FILE = VERSION
# ===== Executables =====
@@ -103,6 +105,7 @@ lint:
$(ESLINT) \
`find $(LIB_DIR) -name '*.js'` \
`find $(SPEC_DIR) -name '*.js' -and -not -path '$(SPEC_DIR)/vendor/*'` \
+ $(SPEC_SERVER_FILE) \
$(BENCHMARK_DIR)/*.js \
$(BENCHMARK_RUN) \
$(PEGJS)
diff --git a/spec/.eslintrc.json b/spec/.eslintrc.json
index 52939e2..a3dc8e0 100644
--- a/spec/.eslintrc.json
+++ b/spec/.eslintrc.json
@@ -1,5 +1,6 @@
{
"env": {
+ "commonjs": true,
"jasmine": true
}
}
diff --git a/spec/README.md b/spec/README.md
index fc1376a..71c8cd9 100644
--- a/spec/README.md
+++ b/spec/README.md
@@ -38,18 +38,12 @@ All commands in the following steps need to be executed in PEG.js root directory
$ npm install
```
- 3. Build browser version of PEG.js:
+ 3. Serve the spec suite using a web server:
```console
- $ make browser
+ $ spec/server
```
- 4. Serve PEG.js root directory using a web server:
+ 4. Point your browser to the [spec suite](http://localhost:8000/).
- ```console
- $ node_modules/.bin/http-server
- ```
-
- 5. Point your browser to the [spec suite](http://localhost:8080/spec/index.html).
-
- 6. Watch the specs pass (or fail).
+ 5. Watch the specs pass (or fail).
diff --git a/spec/api/generated-parser-api.spec.js b/spec/api/generated-parser-api.spec.js
index 3231d93..3ff1dcf 100644
--- a/spec/api/generated-parser-api.spec.js
+++ b/spec/api/generated-parser-api.spec.js
@@ -1,8 +1,10 @@
/* eslint no-console: 0 */
-/* global peg, console */
+/* global console */
"use strict";
+var peg = require("../../lib/peg");
+
describe("generated parser API", function() {
describe("parse", function() {
it("parses input", function() {
diff --git a/spec/api/pegjs-api.spec.js b/spec/api/pegjs-api.spec.js
index 5448f12..9d02c66 100644
--- a/spec/api/pegjs-api.spec.js
+++ b/spec/api/pegjs-api.spec.js
@@ -1,7 +1,7 @@
-/* global peg */
-
"use strict";
+var peg = require("../../lib/peg");
+
describe("PEG.js API", function() {
describe("generate", function() {
it("generates a parser", function() {
diff --git a/spec/api/plugin-api.spec.js b/spec/api/plugin-api.spec.js
index 73eb7f8..d89356f 100644
--- a/spec/api/plugin-api.spec.js
+++ b/spec/api/plugin-api.spec.js
@@ -1,7 +1,7 @@
-/* global peg */
-
"use strict";
+var peg = require("../../lib/peg");
+
describe("plugin API", function() {
beforeEach(function() {
this.addMatchers({
diff --git a/spec/behavior/generated-parser-behavior.spec.js b/spec/behavior/generated-parser-behavior.spec.js
index 8a0107b..2824569 100644
--- a/spec/behavior/generated-parser-behavior.spec.js
+++ b/spec/behavior/generated-parser-behavior.spec.js
@@ -1,8 +1,10 @@
/* eslint no-console: 0 */
-/* global peg, console */
+/* global console */
"use strict";
+var peg = require("../../lib/peg");
+
describe("generated parser behavior", function() {
function varyOptimizationOptions(block) {
function clone(object) {
diff --git a/spec/helpers.js b/spec/helpers.js
deleted file mode 100644
index 3e60a00..0000000
--- a/spec/helpers.js
+++ /dev/null
@@ -1,9 +0,0 @@
-/* global require */
-
-"use strict";
-
-(function(root) {
- if (typeof module !== 'undefined') {
- root.peg = require("../lib/peg.js");
- }
-}(this));
diff --git a/spec/index.html b/spec/index.html
index 2ab1a45..a0734bd 100644
--- a/spec/index.html
+++ b/spec/index.html
@@ -6,21 +6,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+