Skip to content

Commit

Permalink
Merge pull request #95 from davidchambers/sanctuary-scripts
Browse files Browse the repository at this point in the history
integrate sanctuary-scripts
  • Loading branch information
davidchambers authored Mar 25, 2018
2 parents fc40ce3 + c9a3adf commit 32c8065
Show file tree
Hide file tree
Showing 40 changed files with 555 additions and 227 deletions.
5 changes: 5 additions & 0 deletions .config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repo-owner = davidchambers
repo-name = doctest
author-name = David Chambers <[email protected]>
source-files = lib/*.js
version-tag-prefix =
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/test/**/*.js
!/test/index.js
14 changes: 14 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"root": true,
"extends": ["./node_modules/sanctuary-style/eslint-es3.json"],
"env": {"node": true},
"overrides": [
{
"files": ["lib/doctest.js"],
"rules": {
"no-multiple-empty-lines": ["error", {"max": 2, "maxEOF": 0}],
"spaced-comment": ["error", "always", {"markers": ["/"]}]
}
}
]
}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ node_js:
- "4"
- "6"
- "8"
install:
- make setup
script:
- make test lint
before_install:
- git fetch origin refs/heads/master:refs/heads/master
- if [[ "$TRAVIS_PULL_REQUEST_BRANCH" ]] ; then git checkout -b "$TRAVIS_PULL_REQUEST_BRANCH" ; fi
- if [[ "$TRAVIS_NODE_VERSION" == 4 ]] ; then npm install --global [email protected] ; fi
24 changes: 24 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Contributing

1. Update local master branch:

$ git checkout master
$ git pull upstream master

2. Create feature branch:

$ git checkout -b feature-x

3. Make one or more atomic commits, and ensure that each commit has a
descriptive commit message. Commit messages should be line wrapped
at 72 characters.

4. Run `npm test`, and address any errors. Preferably, fix commits in place
using `git rebase` or `git commit --amend` to make the changes easier to
review.

5. Push:

$ git push origin feature-x

6. Open a pull request.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (c) 2012..2016 David Chambers <[email protected]>
Copyright (c) 2016 David Chambers <[email protected]>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
Expand Down
34 changes: 0 additions & 34 deletions Makefile

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ Each doctest has access to variables in its scope chain.
### Running the test suite

```console
$ make setup
$ make test
$ npm install
$ npm test
```


Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@
"sanctuary-type-classes": "8.1.x"
},
"devDependencies": {
"eslint": "4.9.x",
"sanctuary-style": "1.1.x",
"xyz": "2.1.x"
"sanctuary-scripts": "1.1.x"
},
"scripts": {
"doctest": "sanctuary-doctest",
"lint": "sanctuary-lint",
"release": "sanctuary-release",
"test": "npm run lint && sanctuary-test && npm run doctest"
},
"files": [
"/bin/",
Expand Down
Empty file added scripts/doctest
Empty file.
Empty file added scripts/generate-readme
Empty file.
4 changes: 4 additions & 0 deletions scripts/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -euf -o pipefail

node -- test/index.js
4 changes: 0 additions & 4 deletions test/amd/results.js

This file was deleted.

11 changes: 11 additions & 0 deletions test/amd/results.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
[
"doctest in AMD module",
[
true,
"32",
"32",
5
]
]
]
4 changes: 0 additions & 4 deletions test/bin/results.js

This file was deleted.

11 changes: 11 additions & 0 deletions test/bin/results.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
[
"executable without file extension",
[
true,
"42",
"42",
4
]
]
]
4 changes: 0 additions & 4 deletions test/commonjs/exports/results.js

This file was deleted.

11 changes: 11 additions & 0 deletions test/commonjs/exports/results.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
[
"exports",
[
true,
"42",
"42",
2
]
]
]
4 changes: 0 additions & 4 deletions test/commonjs/module.exports/results.js

This file was deleted.

11 changes: 11 additions & 0 deletions test/commonjs/module.exports/results.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
[
"module.exports",
[
true,
"42",
"42",
2
]
]
]
4 changes: 0 additions & 4 deletions test/commonjs/require/results.js

This file was deleted.

11 changes: 11 additions & 0 deletions test/commonjs/require/results.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
[
"require another CommonJS module",
[
true,
"\"function\"",
"\"function\"",
2
]
]
]
4 changes: 0 additions & 4 deletions test/commonjs/strict/results.js

This file was deleted.

11 changes: 11 additions & 0 deletions test/commonjs/strict/results.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
[
"preserves 'use strict' directive",
[
true,
"undefined",
"undefined",
4
]
]
]
31 changes: 0 additions & 31 deletions test/exceptions/results.js

This file was deleted.

92 changes: 92 additions & 0 deletions test/exceptions/results.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
[
[
"input evaluates to Error with expected message",
[
true,
"Error: Invalid value",
"Error: Invalid value",
3
]
],
[
"input evaluates to Error without expected message",
[
false,
"Error",
"Error: Invalid value",
6
]
],
[
"input evaluates to Error with unexpected message",
[
false,
"Error: Invalid value",
"Error",
9
]
],
[
"input evaluates to Error with unexpected message",
[
false,
"Error: Invalid value",
"Error: XXX",
12
]
],
[
"evaluating input does not throw expected exception",
[
false,
"Error: Invalid value",
"! Error: Invalid value",
15
]
],
[
"evaluating input throws unexpected exception",
[
false,
"! Error: Invalid value",
"Error: Invalid value",
18
]
],
[
"evaluating input throws exception as expected, of expected type",
[
true,
"! TypeError",
"! TypeError",
21
]
],
[
"evaluating input throws exception as expected, of unexpected type",
[
false,
"! TypeError",
"! Error",
24
]
],
[
"evaluating input throws exception as expected, with expected message",
[
true,
"! Error: Invalid value",
"! Error: Invalid value",
27
]
],
[
"evaluating input throws exception as expected, with unexpected message",
[
false,
"! Error: Invalid value",
"! Error: XXX",
30
]
]
]
4 changes: 0 additions & 4 deletions test/fantasy-land/results.js

This file was deleted.

11 changes: 11 additions & 0 deletions test/fantasy-land/results.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
[
"uses Z.equals for equality checks",
[
true,
"Absolute(-1)",
"Absolute(1)",
2
]
]
]
7 changes: 0 additions & 7 deletions test/harmony/results.js

This file was deleted.

7 changes: 7 additions & 0 deletions test/harmony/results.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
["seq.next().value", [true, "1", "1", 13]],
["seq.next().value", [true, "1", "1", 15]],
["seq.next().value", [true, "2", "2", 17]],
["seq.next().value", [true, "3", "3", 19]],
["seq.next().value", [true, "5", "5", 21]]
]
Loading

0 comments on commit 32c8065

Please sign in to comment.