Skip to content

Commit

Permalink
improve hasCallingCode coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
scub45t3v3 committed Dec 31, 2019
1 parent c60d785 commit d49def5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
13 changes: 13 additions & 0 deletions TEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,19 @@ unit
.function(test.hasCallingCode);
```

should return true for null|undefined when callingCode is not set.

```js
const test = new Country();
unit
.bool(test.hasCallingCode())
.isTrue()
.bool(test.hasCallingCode(undefined))
.isTrue()
.bool(test.hasCallingCode(null))
.isTrue();
```

should return true for calling codes already in the array.

```js
Expand Down
12 changes: 12 additions & 0 deletions test/Country.js
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,18 @@ describe('Country', () => {
.function(test.hasCallingCode);
}); // end it

it('should return true for null|undefined when callingCode is not set', () => {
const test = new Country();

unit
.bool(test.hasCallingCode())
.isTrue()
.bool(test.hasCallingCode(undefined))
.isTrue()
.bool(test.hasCallingCode(null))
.isTrue();
}); // end it

it('should return true for calling codes already in the array', () => {
const test = new Country();

Expand Down

0 comments on commit d49def5

Please sign in to comment.