Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Enable classProperties and classPrivateProperties parsers and c…
…overage. (#379)
- Loading branch information
1 parent
72b0f05
commit c09dc38
Showing
5 changed files
with
67 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
packages/istanbul-lib-instrument/test/specs/class-properties.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
name: class property declaration | ||
guard: isClassPropAvailable | ||
code: | | ||
class Foo { | ||
bar = 1; | ||
uninitialized; | ||
} | ||
output = args === 1 ? new Foo().bar : args | ||
tests: | ||
- name: covered | ||
args: 1 | ||
out: 1 | ||
lines: {'2': 1, '5': 1} | ||
statements: {'0': 1, '1': 1} | ||
branches: {'0': [1, 0]} | ||
functions: {} | ||
- name: not covered | ||
args: 2 | ||
out: 2 | ||
lines: {'2': 0, '5': 1} | ||
statements: {'0': 0, '1': 1} | ||
branches: {'0': [0, 1]} | ||
functions: {} | ||
--- | ||
name: class private property declaration | ||
guard: isClassPrivatePropAvailable | ||
code: | | ||
class Foo { | ||
#bar = 1; | ||
get bar() { return this.#bar; } | ||
#uninitialized; | ||
} | ||
output = args === 1 ? new Foo().bar : args | ||
tests: | ||
- name: covered | ||
args: 1 | ||
out: 1 | ||
lines: {'2': 1, '3': 1, '6': 1} | ||
statements: {'0': 1, '1': 1, '2': 1} | ||
branches: {'0': [1, 0]} | ||
functions: {'0': 1} | ||
- name: not covered | ||
args: 2 | ||
out: 2 | ||
lines: {'2': 0, '3': 0, '6': 1} | ||
statements: {'0': 0, '1': 0, '2': 1} | ||
branches: {'0': [0, 1]} | ||
functions: {'0': 0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters