@@ -55,42 +55,29 @@ describe('Soft Assertions', () => {
5555 await Promise . all ( [ elementSoftToHaveText , elementsSoftToHaveText , elementsSoftNotToHaveText ] )
5656 } )
5757
58- it ( 'should handle non-promises properly' , ( ) => {
58+ it ( 'should handle non-promises matchers properly by not using promises ' , ( ) => {
5959 const softService = SoftAssertService . getInstance ( )
6060 softService . setCurrentTest ( 'non-promise-1' , 'test name' , 'test file' )
6161
62+ // Base line on Jest 'expect' library
6263 expect ( expectLib ( true ) . toBe ( true ) ) . toBeUndefined ( )
6364 expect ( expectLib ( true ) . toBe ) . toBeInstanceOf ( Function )
6465 expect ( expectLib ( true ) . toBe ( true ) ) . not . toBeInstanceOf ( Promise )
6566 expect ( expectLib ( true ) . not . toBe ( false ) ) . not . toBeInstanceOf ( Promise )
6667
68+ // wdio expect
6769 expect ( expectWdio ( true ) . toBe ( true ) ) . toBeUndefined ( )
6870 expect ( expectWdio ( true ) . toBe ) . toBeInstanceOf ( Function )
6971 expect ( expectWdio ( true ) . toBe ( true ) ) . not . toBeInstanceOf ( Promise )
7072 expect ( expectWdio ( true ) . not . toBe ( false ) ) . not . toBeInstanceOf ( Promise )
7173
74+ // wdio expect.soft
7275 expect ( expectWdio . soft ( true ) . toBe ( true ) ) . toBeUndefined ( )
7376 expect ( expectWdio . soft ( true ) . toBe ) . toBeInstanceOf ( Function )
7477 expect ( expectWdio . soft ( true ) . toBe ) . not . toBeInstanceOf ( Promise )
7578 expect ( expectWdio . soft ( true ) . not . toBe ( false ) ) . not . toBeInstanceOf ( Promise )
7679 } )
7780
78- it . for ( [
79- '' ,
80- 2 ,
81- [ ] ,
82- ] ) ( 'should handle non-promises and return a non-promise target to have the correct runtime type' , ( actualPromise ) => {
83- const softService = SoftAssertService . getInstance ( )
84- softService . setCurrentTest ( 'non-promise-2' , 'test name' , 'test file' )
85-
86- const wdioExpect = expectWdio ( actualPromise )
87- expect ( wdioExpect ) . not . toBeInstanceOf ( Promise )
88-
89- const softExpect = expectWdio . soft ( actualPromise )
90- expect ( softExpect ) . toBeInstanceOf ( Object )
91- expect ( softExpect ) . not . toBeInstanceOf ( Promise )
92- } )
93-
9481 it ( 'should not throw immediately on failure' , async ( ) => {
9582 const softService = SoftAssertService . getInstance ( )
9683 softService . setCurrentTest ( 'test-1' , 'test name' , 'test file' )
@@ -213,7 +200,7 @@ describe('Soft Assertions', () => {
213200 expect ( failures [ 0 ] . matcherName ) . toBe ( 'not.toEqual' )
214201 } )
215202
216- it . skip ( 'not - should support basic matcher success' , async ( ) => {
203+ it ( 'not - should support basic matcher success' , async ( ) => {
217204 const softService = SoftAssertService . getInstance ( )
218205 softService . setCurrentTest ( 'test-10' , 'test name' , 'test file' )
219206
0 commit comments