Currently, it seems that test npm script runs lab -t 100 -a @hapi/code -L -Y and this command runs all tests written in the project folder. This might be not necessary every time and can be inefficient in most cases because contributors are usually modifying and testing a single case (or a couple of cases). I think a new script that can select a certain test will speed up the process.
Do you have a new or modified API suggestion to solve the problem?
I think a script something like below, with grep and the keyword will be enough. I've confirmed that this works in my PR.
Add a select-test in sciprts section in package.json
"scripts": {
"prepublishOnly": "cd browser && npm install && npm run build",
"test": "lab -t 100 -a @hapi/code -L -Y",
"test-cov-html": "lab -r html -o coverage.html -a @hapi/code",
"select-test": "lab -t 100 -a @hapi/code -L -Y -g"
},
Run this command with the keyword
npm run select-test "uri after encoding"
joi@17.12.2 select-test
lab -t 100 -a @hapi/code -L -Y -g uri after encoding
.
1 tests complete
Test duration: 131 ms
Assertions count: 5 (verbosity: 5.00)
Leaks: No issues
Coverage: 60.11% (3060/7672)
Runtime
node.js
Runtime version
v18.19.1
Module version
17.12.2
Used with
standalone
Any other relevant information
No response
What problem are you trying to solve?
Currently, it seems that
test
npm script runslab -t 100 -a @hapi/code -L -Y
and this command runs all tests written in the project folder. This might be not necessary every time and can be inefficient in most cases because contributors are usually modifying and testing a single case (or a couple of cases). I think a new script that can select a certain test will speed up the process.Do you have a new or modified API suggestion to solve the problem?
I think a script something like below, with
grep
and the keyword will be enough. I've confirmed that this works in my PR.select-test
insciprts
section inpackage.json
.
1 tests complete Test duration: 131 ms Assertions count: 5 (verbosity: 5.00) Leaks: No issues Coverage: 60.11% (3060/7672)