diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 07718c3..c0ebf80 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,7 +46,7 @@ see good examples. When appropriate, add documentation and tests. -Before submitting, make sure your change passes the specs (`gulp spec`) and +Before submitting, make sure your change passes the tests (`gulp test`) and ESLint checks (`gulp lint`). [issues]: https://github.com/pegjs/pegjs/issues diff --git a/gulpfile.js b/gulpfile.js index e429b2d..fbd5a5c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -32,9 +32,9 @@ const HEADER = [ const JS_FILES = [ "lib/**/*.js", "!lib/parser.js", - "spec/**/*.js", - "spec/server", - "!spec/vendor/**/*", + "test/**/*.js", + "test/server", + "!test/vendor/**/*", "benchmark/**/*.js", "benchmark/run", "benchmark/server", @@ -43,9 +43,9 @@ const JS_FILES = [ "gulpfile.js" ]; -const SPEC_FILES = [ - "spec/**/*.js", - "!spec/vendor/**/*" +const TEST_FILES = [ + "test/**/*.js", + "!test/vendor/**/*" ]; function generate(contents) { @@ -63,9 +63,9 @@ gulp.task("lint", () => .pipe(eslint.failAfterError()) ); -// Run specs. -gulp.task("spec", () => - gulp.src(SPEC_FILES, { read: false }) +// Run tests. +gulp.task("test", () => + gulp.src(TEST_FILES, { read: false }) .pipe(mocha()) ); @@ -104,5 +104,5 @@ gulp.task("parser", () => // Default task. gulp.task("default", cb => - runSequence("lint", "spec", cb) + runSequence("lint", "test", cb) ); diff --git a/spec/.eslintrc.json b/test/.eslintrc.json similarity index 100% rename from spec/.eslintrc.json rename to test/.eslintrc.json diff --git a/spec/README.md b/test/README.md similarity index 67% rename from spec/README.md rename to test/README.md index b9d96ff..4745955 100644 --- a/spec/README.md +++ b/test/README.md @@ -1,7 +1,7 @@ -PEG.js Spec Suite +PEG.js Test Suite ================= -This is the PEG.js spec suite. It ensures PEG.js works correctly. All specs +This is the PEG.js test suite. It ensures PEG.js works correctly. All tests should always pass on all supported platforms. Running in Node.js @@ -16,13 +16,13 @@ All commands in the following steps need to be executed in PEG.js root directory $ npm install ``` - 2. Execute the spec suite: + 2. Execute the test suite: ```console - $ gulp spec + $ gulp test ``` - 3. Watch the specs pass (or fail). + 3. Watch the tests pass (or fail). Running in the Browser ---------------------- @@ -38,12 +38,12 @@ All commands in the following steps need to be executed in PEG.js root directory $ npm install ``` - 3. Serve the spec suite using a web server: + 3. Serve the test suite using a web server: ```console - $ spec/server + $ test/server ``` - 4. Point your browser to the [spec suite](http://localhost:8000/). + 4. Point your browser to the [test suite](http://localhost:8000/). - 5. Watch the specs pass (or fail). + 5. Watch the tests pass (or fail). diff --git a/spec/api/generated-parser-api.spec.js b/test/api/generated-parser-api.spec.js similarity index 100% rename from spec/api/generated-parser-api.spec.js rename to test/api/generated-parser-api.spec.js diff --git a/spec/api/pegjs-api.spec.js b/test/api/pegjs-api.spec.js similarity index 98% rename from spec/api/pegjs-api.spec.js rename to test/api/pegjs-api.spec.js index 704ba36..2a4a80c 100644 --- a/spec/api/pegjs-api.spec.js +++ b/test/api/pegjs-api.spec.js @@ -154,7 +154,7 @@ describe("PEG.js API", function() { }); // The |optimize| option isn't tested because there is no meaningful way to - // write the specs without turning this into a performance test. + // write the tests without turning this into a performance test. describe("output", function() { let grammar = "start = 'a'"; @@ -191,7 +191,7 @@ describe("PEG.js API", function() { // becasue there is no meaningful way to thest their effects without turning // this into an integration test. - // The |plugins| option is tested in plugin API specs. + // The |plugins| option is tested in plugin API tests. it("accepts custom options", function() { peg.generate("start = 'a'", { foo: 42 }); diff --git a/spec/api/plugin-api.spec.js b/test/api/plugin-api.spec.js similarity index 100% rename from spec/api/plugin-api.spec.js rename to test/api/plugin-api.spec.js diff --git a/spec/behavior/generated-parser-behavior.spec.js b/test/behavior/generated-parser-behavior.spec.js similarity index 99% rename from spec/behavior/generated-parser-behavior.spec.js rename to test/behavior/generated-parser-behavior.spec.js index adee86d..0ef1d56 100644 --- a/spec/behavior/generated-parser-behavior.spec.js +++ b/test/behavior/generated-parser-behavior.spec.js @@ -108,7 +108,7 @@ describe("generated parser behavior", function() { } // Helper activation needs to put inside a |beforeEach| block because the - // helpers conflict with the ones in spec/unit/parser.spec.js. + // helpers conflict with the ones in test/unit/parser.spec.js. beforeEach(function() { chai.use(helpers); }); diff --git a/spec/index.html b/test/index.html similarity index 100% rename from spec/index.html rename to test/index.html diff --git a/spec/server b/test/server similarity index 82% rename from spec/server rename to test/server index 39dcdde..c61690e 100755 --- a/spec/server +++ b/test/server @@ -4,8 +4,8 @@ /* eslint-env node */ -// Small server whose main purpose is to ensure that both the specced code and -// the specs get passed through Babel & Browserify before they are served to the +// Small server whose main purpose is to ensure that both the tested code and +// the tests get passed through Babel & Browserify before they are served to the // browser. let babelify = require("babelify"); diff --git a/spec/unit/compiler/passes/generate-bytecode.spec.js b/test/unit/compiler/passes/generate-bytecode.spec.js similarity index 100% rename from spec/unit/compiler/passes/generate-bytecode.spec.js rename to test/unit/compiler/passes/generate-bytecode.spec.js diff --git a/spec/unit/compiler/passes/helpers.js b/test/unit/compiler/passes/helpers.js similarity index 100% rename from spec/unit/compiler/passes/helpers.js rename to test/unit/compiler/passes/helpers.js diff --git a/spec/unit/compiler/passes/remove-proxy-rules.spec.js b/test/unit/compiler/passes/remove-proxy-rules.spec.js similarity index 100% rename from spec/unit/compiler/passes/remove-proxy-rules.spec.js rename to test/unit/compiler/passes/remove-proxy-rules.spec.js diff --git a/spec/unit/compiler/passes/report-duplicate-labels.spec.js b/test/unit/compiler/passes/report-duplicate-labels.spec.js similarity index 100% rename from spec/unit/compiler/passes/report-duplicate-labels.spec.js rename to test/unit/compiler/passes/report-duplicate-labels.spec.js diff --git a/spec/unit/compiler/passes/report-duplicate-rules.spec.js b/test/unit/compiler/passes/report-duplicate-rules.spec.js similarity index 100% rename from spec/unit/compiler/passes/report-duplicate-rules.spec.js rename to test/unit/compiler/passes/report-duplicate-rules.spec.js diff --git a/spec/unit/compiler/passes/report-infinite-recursion.spec.js b/test/unit/compiler/passes/report-infinite-recursion.spec.js similarity index 100% rename from spec/unit/compiler/passes/report-infinite-recursion.spec.js rename to test/unit/compiler/passes/report-infinite-recursion.spec.js diff --git a/spec/unit/compiler/passes/report-infinite-repetition.spec.js b/test/unit/compiler/passes/report-infinite-repetition.spec.js similarity index 100% rename from spec/unit/compiler/passes/report-infinite-repetition.spec.js rename to test/unit/compiler/passes/report-infinite-repetition.spec.js diff --git a/spec/unit/compiler/passes/report-undefined-rules.spec.js b/test/unit/compiler/passes/report-undefined-rules.spec.js similarity index 100% rename from spec/unit/compiler/passes/report-undefined-rules.spec.js rename to test/unit/compiler/passes/report-undefined-rules.spec.js diff --git a/spec/unit/parser.spec.js b/test/unit/parser.spec.js similarity index 99% rename from spec/unit/parser.spec.js rename to test/unit/parser.spec.js index 31bb473..f4955fb 100644 --- a/spec/unit/parser.spec.js +++ b/test/unit/parser.spec.js @@ -218,7 +218,7 @@ describe("PEG.js grammar parser", function() { // Helper activation needs to put inside a |beforeEach| block because the // helpers conflict with the ones in - // spec/behavior/generated-parser-behavior.spec.js. + // test/behavior/generated-parser-behavior.spec.js. beforeEach(function() { chai.use(helpers); }); diff --git a/spec/vendor/mocha/LICENSE b/test/vendor/mocha/LICENSE similarity index 100% rename from spec/vendor/mocha/LICENSE rename to test/vendor/mocha/LICENSE diff --git a/spec/vendor/mocha/mocha.css b/test/vendor/mocha/mocha.css similarity index 100% rename from spec/vendor/mocha/mocha.css rename to test/vendor/mocha/mocha.css diff --git a/spec/vendor/mocha/mocha.js b/test/vendor/mocha/mocha.js similarity index 100% rename from spec/vendor/mocha/mocha.js rename to test/vendor/mocha/mocha.js