Use "test" and "tests" instead of "spec" and "specs"

This reflects a convention used in most JavaScript projects. The change
involves renaming the "spec" directory, Gulp task, etc.
redux
David Majda 8 years ago
parent 73de2c9384
commit f5a372b075

@ -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

@ -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)
);

@ -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).

@ -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 });

@ -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);
});

@ -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");

@ -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);
});
Loading…
Cancel
Save