Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchambers committed Jan 7, 2024
1 parent bd5591e commit 8de2ac0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 21 deletions.
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",
"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[@]}"

0 comments on commit 8de2ac0

Please sign in to comment.