Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[email protected] #179

Merged
merged 1 commit into from
Jan 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .config
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ repo-name = doctest
author-name = David Chambers <[email protected]>
source-files = bin/doctest lib/**/*.js
readme-source-files =
test-files = test/index.js
version-tag-prefix =
17 changes: 8 additions & 9 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@
"comma-dangle": ["error", {"arrays": "always-multiline", "objects": "always-multiline", "imports": "always-multiline", "exports": "always-multiline", "functions": "never"}]
},
"overrides": [
{
"files": ["README.md"],
"globals": {"doctest": "readonly"},
"rules": {
"no-extra-semi": ["off"],
"no-unused-vars": ["error", {"varsIgnorePattern": "^(toFahrenheit)$"}]
}
},
{
"files": ["bin/doctest"],
"parserOptions": {"sourceType": "script"}
Expand All @@ -26,9 +18,16 @@
"spaced-comment": ["error", "always", {"markers": ["/"]}]
}
},
{
"files": ["test/**/*.js"],
"rules": {
"max-len": ["off"]
}
},
{
"files": ["test/commonjs/**/index.js"],
"parserOptions": {"sourceType": "script"}
"parserOptions": {"sourceType": "script"},
"globals": {"__doctest": "readonly"}
}
]
}
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
"sanctuary-type-classes": "13.0.x"
},
"devDependencies": {
"c8": "8.0.x",
"oletus": "4.0.x",
Comment on lines -33 to -34
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These dependencies are now included. :)

"sanctuary-scripts": "6.0.x"
"sanctuary-scripts": "7.0.x"
},
"scripts": {
"doctest": "sanctuary-doctest",
Expand Down
27 changes: 18 additions & 9 deletions scripts/test
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
#!/usr/bin/env bash
set -euf -o pipefail

source "${BASH_SOURCE%/*}/../node_modules/sanctuary-scripts/functions"
source "$(dirname "$(dirname "$(realpath "${BASH_SOURCE[0]}")")")/node_modules/sanctuary-scripts/functions"

branches="$(get min-branch-coverage)"

set +f ; shopt -s globstar nullglob
files=($(get source-files))
# shellcheck disable=SC2207
source_files=($(get source-files))
# shellcheck disable=SC2207
test_files=($(get test-files))
set -f ; shopt -u globstar nullglob

node_modules/.bin/c8 \
--check-coverage \
--100 \
--reporter text \
--reporter html \
$(printf ' --include %s' "${files[@]}") \
node --experimental-vm-modules -- node_modules/.bin/oletus -- test/index.js
args=(
--check-coverage
--branches "$branches"
--functions 0
--lines 0
--statements 0
)
for name in "${source_files[@]}" ; do
args+=(--include "$name")
done
node_modules/.bin/c8 "${args[@]}" -- node --experimental-vm-modules -- node_modules/.bin/oletus -- "${test_files[@]}"