bahmutov / bahmutov/test-mole

Describe how test-mole can be used when library implements feature

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
3
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Example from https://github.com/kensho/check-more-types -

``` js
(function registerAdditionalChecks(check) {
function defined(value) {
return typeof value !== 'undefined'; // 1
}
if (!check.defined) {
check.defined = defined;
}
}(window.check));
```

check-types.js now implements check.defined, we no longer test `// 1` code!
Test mole can actually test code even if it is not testable by the outside code.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the check-types.js reference in the issue and the check-more-types example at the linked URL. Document how test-mole can exercise the defined function inside the closure, including the branch marked // 1; done when the usage is explained with a representative example.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.