@@ -82,14 +82,24 @@ it('should test something', () => {
8282 code : 'expect(promise).to.be.rejectedWith(Error)' ,
8383 parserOptions : { ecmaVersion : 2021 } ,
8484 } ,
85+ {
86+ options : [ { properties : [ 'throw' ] } ] ,
87+ code : `
88+ it("does not fail passed property", function() {
89+ expect(result).to.throw;
90+ });
91+ ` ,
92+ } ,
8593 ] ,
94+
8695 invalid : [
8796 {
8897 code : 'expect(() => someFn()).to.throw' ,
8998 parserOptions : { ecmaVersion : 2021 } ,
9099 errors : [
91100 {
92- messageId : 'methodNotInvoked' ,
101+ message :
102+ 'expect().to.throw must be invoked with parentheses, e.g., expect().to.throw()' ,
93103 } ,
94104 ] ,
95105 } ,
@@ -98,16 +108,8 @@ it('should test something', () => {
98108 parserOptions : { ecmaVersion : 2021 } ,
99109 errors : [
100110 {
101- messageId : 'methodNotInvoked' ,
102- } ,
103- ] ,
104- } ,
105- {
106- code : 'expect("pineapple").to.include' ,
107- parserOptions : { ecmaVersion : 2021 } ,
108- errors : [
109- {
110- messageId : 'methodNotInvoked' ,
111+ message :
112+ 'expect().to.be.a must be invoked with parentheses, e.g., expect().to.be.a()' ,
111113 } ,
112114 ] ,
113115 } ,
@@ -116,7 +118,8 @@ it('should test something', () => {
116118 parserOptions : { ecmaVersion : 2021 } ,
117119 errors : [
118120 {
119- messageId : 'methodNotInvoked' ,
121+ message :
122+ 'expect().to.not.include must be invoked with parentheses, e.g., expect().to.not.include()' ,
120123 } ,
121124 ] ,
122125 } ,
@@ -125,7 +128,8 @@ it('should test something', () => {
125128 parserOptions : { ecmaVersion : 2021 } ,
126129 errors : [
127130 {
128- messageId : 'methodNotInvoked' ,
131+ message :
132+ 'expect().to.throw must be invoked with parentheses, e.g., expect().to.throw()' ,
129133 } ,
130134 ] ,
131135 } ,
@@ -134,7 +138,8 @@ it('should test something', () => {
134138 parserOptions : { ecmaVersion : 2021 } ,
135139 errors : [
136140 {
137- messageId : 'methodNotInvoked' ,
141+ message :
142+ 'expect().to.not.throw must be invoked with parentheses, e.g., expect().to.not.throw()' ,
138143 } ,
139144 ] ,
140145 } ,
@@ -143,7 +148,8 @@ it('should test something', () => {
143148 parserOptions : { ecmaVersion : 2021 } ,
144149 errors : [
145150 {
146- messageId : 'methodNotInvoked' ,
151+ message :
152+ 'expect().to.not.throws must be invoked with parentheses, e.g., expect().to.not.throws()' ,
147153 } ,
148154 ] ,
149155 } ,
@@ -152,7 +158,8 @@ it('should test something', () => {
152158 parserOptions : { ecmaVersion : 2021 } ,
153159 errors : [
154160 {
155- messageId : 'methodNotInvoked' ,
161+ message :
162+ 'expect().to.not.Throw must be invoked with parentheses, e.g., expect().to.not.Throw()' ,
156163 } ,
157164 ] ,
158165 } ,
@@ -161,7 +168,8 @@ it('should test something', () => {
161168 parserOptions : { ecmaVersion : 2021 } ,
162169 errors : [
163170 {
164- messageId : 'methodNotInvoked' ,
171+ message :
172+ 'expect().not.to.throw must be invoked with parentheses, e.g., expect().not.to.throw()' ,
165173 } ,
166174 ] ,
167175 } ,
@@ -170,7 +178,8 @@ it('should test something', () => {
170178 parserOptions : { ecmaVersion : 2021 } ,
171179 errors : [
172180 {
173- messageId : 'methodNotInvoked' ,
181+ message :
182+ 'expect().to.throw must be invoked with parentheses, e.g., expect().to.throw()' ,
174183 } ,
175184 ] ,
176185 } ,
@@ -182,7 +191,8 @@ it('should test something', () => {
182191 parserOptions : { ecmaVersion : 2021 } ,
183192 errors : [
184193 {
185- messageId : 'methodNotInvoked' ,
194+ message :
195+ 'expect().to.throw must be invoked with parentheses, e.g., expect().to.throw()' ,
186196 } ,
187197 ] ,
188198 } ,
@@ -191,7 +201,8 @@ it('should test something', () => {
191201 parserOptions : { ecmaVersion : 2021 } ,
192202 errors : [
193203 {
194- messageId : 'methodNotInvoked' ,
204+ message :
205+ 'expect().to.throw must be invoked with parentheses, e.g., expect().to.throw()' ,
195206 } ,
196207 ] ,
197208 } ,
@@ -200,7 +211,8 @@ it('should test something', () => {
200211 parserOptions : { ecmaVersion : 2021 } ,
201212 errors : [
202213 {
203- messageId : 'methodNotInvoked' ,
214+ message :
215+ 'expect().to.throw must be invoked with parentheses, e.g., expect().to.throw()' ,
204216 } ,
205217 ] ,
206218 } ,
0 commit comments