@@ -37,7 +37,6 @@ describe('ComponentRegistry', () => {
3737 } ) ;
3838
3939 it ( 'registers and retrieves React function components' , ( ) => {
40- expect . assertions ( 1 ) ;
4140 const C1 = ( ) => < div > HELLO</ div > ;
4241 ComponentRegistry . register ( { C1 } ) ;
4342 const actual = ComponentRegistry . get ( 'C1' ) ;
@@ -46,7 +45,6 @@ describe('ComponentRegistry', () => {
4645 } ) ;
4746
4847 it ( 'registers and retrieves Render-Function components where property renderFunction is set and zero params' , ( ) => {
49- expect . assertions ( 1 ) ;
5048 const C1 = ( ) => < div > HELLO</ div > ;
5149 C1 . renderFunction = true ;
5250 ComponentRegistry . register ( { C1 } ) ;
@@ -56,7 +54,6 @@ describe('ComponentRegistry', () => {
5654 } ) ;
5755
5856 it ( 'registers and retrieves ES5 class components' , ( ) => {
59- expect . assertions ( 1 ) ;
6057 const C2 = createReactClass ( {
6158 render ( ) {
6259 return < div > WORLD </ div > ;
@@ -69,7 +66,6 @@ describe('ComponentRegistry', () => {
6966 } ) ;
7067
7168 it ( 'registers and retrieves ES6 class components' , ( ) => {
72- expect . assertions ( 1 ) ;
7369 class C3 extends React . Component {
7470 render ( ) {
7571 return < div > Wow!</ div > ;
@@ -82,7 +78,6 @@ describe('ComponentRegistry', () => {
8278 } ) ;
8379
8480 it ( 'registers and retrieves renderers if 3 params' , ( ) => {
85- expect . assertions ( 1 ) ;
8681 const C4 = ( a1 , a2 , a3 ) => null ;
8782 ComponentRegistry . register ( { C4 } ) ;
8883 const actual = ComponentRegistry . get ( 'C4' ) ;
@@ -95,7 +90,6 @@ describe('ComponentRegistry', () => {
9590 * Thus, tests are cumulative.
9691 */
9792 it ( 'registers and retrieves multiple components' , ( ) => {
98- expect . assertions ( 4 ) ;
9993 // Plain react stateless functional components
10094 const C5 = ( ) => < div > WHY</ div > ;
10195 const C6 = ( ) => < div > NOW</ div > ;
@@ -127,7 +121,6 @@ describe('ComponentRegistry', () => {
127121 } ) ;
128122
129123 it ( 'only detects a renderer function if it has three arguments' , ( ) => {
130- expect . assertions ( 2 ) ;
131124 const C7 = ( a1 , a2 ) => null ;
132125 const C8 = ( a1 ) => null ;
133126 ComponentRegistry . register ( { C7 } ) ;
@@ -148,20 +141,17 @@ describe('ComponentRegistry', () => {
148141 } ) ;
149142
150143 it ( 'throws error for retrieving unregistered component' , ( ) => {
151- expect . assertions ( 1 ) ;
152144 expect ( ( ) => ComponentRegistry . get ( 'foobar' ) ) . toThrow (
153145 / C o u l d n o t f i n d c o m p o n e n t r e g i s t e r e d w i t h n a m e f o o b a r / ,
154146 ) ;
155147 } ) ;
156148
157149 it ( 'throws error for setting null component' , ( ) => {
158- expect . assertions ( 1 ) ;
159150 const C9 = null ;
160151 expect ( ( ) => ComponentRegistry . register ( { C9 } ) ) . toThrow ( / C a l l e d r e g i s t e r w i t h n u l l c o m p o n e n t n a m e d C 9 / ) ;
161152 } ) ;
162153
163154 it ( 'retrieves component asynchronously when registered later' , async ( ) => {
164- expect . assertions ( 1 ) ;
165155 const C1 = ( ) => < div > HELLO</ div > ;
166156 const componentPromise = ComponentRegistry . getOrWaitForComponent ( 'C1' ) ;
167157 ComponentRegistry . register ( { C1 } ) ;
@@ -175,11 +165,12 @@ describe('ComponentRegistry', () => {
175165 } ) ;
176166
177167 it ( 'handles timeout for unregistered components' , async ( ) => {
178- expect . assertions ( 1 ) ;
168+ let error ;
179169 try {
180170 await ComponentRegistry . getOrWaitForComponent ( 'NonExistent' ) ;
181- } catch ( error ) {
182- expect ( error . message ) . toMatch ( / C o u l d n o t f i n d c o m p o n e n t / ) ;
171+ } catch ( e ) {
172+ error = e ;
183173 }
174+ expect ( error . message ) . toMatch ( / C o u l d n o t f i n d c o m p o n e n t / ) ;
184175 } ) ;
185176} ) ;
0 commit comments