File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 4
4
.tscache /
5
5
node_modules /
6
6
tscommand * .txt
7
+ .coverage_data /
7
8
8
9
# Exclude from repo
9
10
out /
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " oscar" ,
3
- "version" : " 1.0.0 " ,
3
+ "version" : " 1.0.1 " ,
4
4
"devDependencies" : {
5
5
"grunt" : " ~0.4.5" ,
6
6
"grunt-ts" : " ~1.12.1" ,
Original file line number Diff line number Diff line change @@ -78,6 +78,26 @@ class Assert {
78
78
throw new Error ( 'Unexpected ' + unexpected + ' instead of ' + value ) ;
79
79
}
80
80
}
81
+
82
+ /**
83
+ * Asserts provided function to throw an error
84
+ * @param {() => void } func [description]
85
+ */
86
+ static throws ( func : ( ) => void ) : void {
87
+ var hasFailed : boolean ;
88
+
89
+ hasFailed = false ;
90
+
91
+ try {
92
+ func ( ) ;
93
+ } catch ( e ) {
94
+ hasFailed = true ;
95
+ } finally {
96
+ if ( ! hasFailed ) {
97
+ throw new Error ( 'Expected function to throw an error' ) ;
98
+ }
99
+ }
100
+ }
81
101
82
102
//endregion Public Methods
83
103
You can’t perform that action at this time.
0 commit comments