Browse Source

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 5 years ago
parent
commit
f5a372b075
  1. 2
      CONTRIBUTING.md
  2. 20
      gulpfile.js
  3. 0
      test/.eslintrc.json
  4. 18
      test/README.md
  5. 0
      test/api/generated-parser-api.spec.js
  6. 4
      test/api/pegjs-api.spec.js
  7. 0
      test/api/plugin-api.spec.js
  8. 2
      test/behavior/generated-parser-behavior.spec.js
  9. 0
      test/index.html
  10. 4
      test/server
  11. 0
      test/unit/compiler/passes/generate-bytecode.spec.js
  12. 0
      test/unit/compiler/passes/helpers.js
  13. 0
      test/unit/compiler/passes/remove-proxy-rules.spec.js
  14. 0
      test/unit/compiler/passes/report-duplicate-labels.spec.js
  15. 0
      test/unit/compiler/passes/report-duplicate-rules.spec.js
  16. 0
      test/unit/compiler/passes/report-infinite-recursion.spec.js
  17. 0
      test/unit/compiler/passes/report-infinite-repetition.spec.js
  18. 0
      test/unit/compiler/passes/report-undefined-rules.spec.js
  19. 2
      test/unit/parser.spec.js
  20. 0
      test/vendor/mocha/LICENSE
  21. 0
      test/vendor/mocha/mocha.css
  22. 0
      test/vendor/mocha/mocha.js

2
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

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

0
spec/.eslintrc.json → test/.eslintrc.json

18
spec/README.md → 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).

0
spec/api/generated-parser-api.spec.js → test/api/generated-parser-api.spec.js

4
spec/api/pegjs-api.spec.js → 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 });

0
spec/api/plugin-api.spec.js → test/api/plugin-api.spec.js

2
spec/behavior/generated-parser-behavior.spec.js → 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);
});

0
spec/index.html → test/index.html

4
spec/server → 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");

0
spec/unit/compiler/passes/generate-bytecode.spec.js → test/unit/compiler/passes/generate-bytecode.spec.js

0
spec/unit/compiler/passes/helpers.js → test/unit/compiler/passes/helpers.js

0
spec/unit/compiler/passes/remove-proxy-rules.spec.js → test/unit/compiler/passes/remove-proxy-rules.spec.js

0
spec/unit/compiler/passes/report-duplicate-labels.spec.js → test/unit/compiler/passes/report-duplicate-labels.spec.js

0
spec/unit/compiler/passes/report-duplicate-rules.spec.js → test/unit/compiler/passes/report-duplicate-rules.spec.js

0
spec/unit/compiler/passes/report-infinite-recursion.spec.js → test/unit/compiler/passes/report-infinite-recursion.spec.js

0
spec/unit/compiler/passes/report-infinite-repetition.spec.js → test/unit/compiler/passes/report-infinite-repetition.spec.js

0
spec/unit/compiler/passes/report-undefined-rules.spec.js → test/unit/compiler/passes/report-undefined-rules.spec.js

2
spec/unit/parser.spec.js → 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);
});

0
spec/vendor/mocha/LICENSE → test/vendor/mocha/LICENSE

0
spec/vendor/mocha/mocha.css → test/vendor/mocha/mocha.css

0
spec/vendor/mocha/mocha.js → test/vendor/mocha/mocha.js

Loading…
Cancel
Save