@@ -760,8 +760,7 @@ describe('inquirer.prompt(...)', () => {
760760 ] ) ;
761761
762762 const output = writeSpy . mock . calls . map ( ( [ text ] ) => text ) . join ( '' ) ;
763- expect ( output ) . toMatch ( / Q u e s t i o n 2 / ) ;
764- expect ( output . includes ( '\x1b[2m' ) ) . toBe ( true ) ;
763+ expect ( output ) . toContain ( 'Question 2' ) ;
765764 expect ( answers ) . toEqual ( { q1 : 'bar' } ) ;
766765 writeSpy . mockRestore ( ) ;
767766 } ) ;
@@ -791,7 +790,7 @@ describe('inquirer.prompt(...)', () => {
791790 ] ) ;
792791
793792 const output = writeSpy . mock . calls . map ( ( [ text ] ) => text ) . join ( '' ) ;
794- expect ( output ) . not . toMatch ( / Q u e s t i o n 2 / ) ;
793+ expect ( output ) . not . toContain ( ' Question 2' ) ;
795794 expect ( answers ) . toEqual ( { q1 : 'bar' , q3 : 'bar' } ) ;
796795 writeSpy . mockRestore ( ) ;
797796 } ) ;
@@ -812,8 +811,8 @@ describe('inquirer.prompt(...)', () => {
812811 ] ) ;
813812
814813 const output = writeSpy . mock . calls . map ( ( [ text ] ) => text ) . join ( '' ) ;
815- expect ( output ) . toMatch ( / A r e y o u s u r e \? . * Y e s / ) ;
816- expect ( output . includes ( '\x1b[2m' ) ) . toBe ( true ) ;
814+ expect ( output ) . toContain ( ' Are you sure?' ) ;
815+ expect ( output ) . toContain ( 'Yes' ) ;
817816 expect ( answers ) . toEqual ( { q1 : 'bar' } ) ;
818817 writeSpy . mockRestore ( ) ;
819818 } ) ;
@@ -838,8 +837,8 @@ describe('inquirer.prompt(...)', () => {
838837 ] ) ;
839838
840839 const output = writeSpy . mock . calls . map ( ( [ text ] ) => text ) . join ( '' ) ;
841- expect ( output ) . toMatch ( / S e l e c t f r u i t . * B a n a n a / ) ;
842- expect ( output . includes ( '\x1b[2m' ) ) . toBe ( true ) ;
840+ expect ( output ) . toContain ( ' Select fruit' ) ;
841+ expect ( output ) . toContain ( 'Banana' ) ;
843842 expect ( answers ) . toEqual ( { q1 : 'bar' } ) ;
844843 writeSpy . mockRestore ( ) ;
845844 } ) ;
@@ -865,8 +864,8 @@ describe('inquirer.prompt(...)', () => {
865864 ] ) ;
866865
867866 const output = writeSpy . mock . calls . map ( ( [ text ] ) => text ) . join ( '' ) ;
868- expect ( output ) . toMatch ( / P i c k f o o d s . * P i z z a , B u r g e r / ) ;
869- expect ( output . includes ( '\x1b[2m' ) ) . toBe ( true ) ;
867+ expect ( output ) . toContain ( ' Pick foods' ) ;
868+ expect ( output ) . toContain ( 'Pizza, Burger' ) ;
870869 expect ( answers ) . toEqual ( { q1 : 'bar' } ) ;
871870 writeSpy . mockRestore ( ) ;
872871 } ) ;
@@ -888,8 +887,8 @@ describe('inquirer.prompt(...)', () => {
888887 ] ) ;
889888
890889 const output = writeSpy . mock . calls . map ( ( [ text ] ) => text ) . join ( '' ) ;
891- expect ( output ) . toMatch ( / E n t e r p a s s w o r d . * \[ P A S S W O R D S E T \] / ) ;
892- expect ( output . includes ( '\x1b[2m' ) ) . toBe ( true ) ;
890+ expect ( output ) . toContain ( ' Enter password' ) ;
891+ expect ( output ) . toContain ( '[PASSWORD SET]' ) ;
893892 expect ( answers ) . toEqual ( { q1 : 'bar' } ) ;
894893 writeSpy . mockRestore ( ) ;
895894 } ) ;
@@ -911,8 +910,8 @@ describe('inquirer.prompt(...)', () => {
911910 ] ) ;
912911
913912 const output = writeSpy . mock . calls . map ( ( [ text ] ) => text ) . join ( '' ) ;
914- expect ( output ) . toMatch ( / W r i t e c o n t e n t . * \[ D e f a u l t C o n t e n t \] / ) ;
915- expect ( output . includes ( '\x1b[2m' ) ) . toBe ( true ) ;
913+ expect ( output ) . toContain ( ' Write content' ) ;
914+ expect ( output ) . toContain ( '[Default Content]' ) ;
916915 expect ( answers ) . toEqual ( { q1 : 'bar' } ) ;
917916 writeSpy . mockRestore ( ) ;
918917 } ) ;
@@ -934,8 +933,8 @@ describe('inquirer.prompt(...)', () => {
934933 ] ) ;
935934
936935 const output = writeSpy . mock . calls . map ( ( [ text ] ) => text ) . join ( '' ) ;
937- expect ( output ) . toMatch ( / E n t e r n a m e . * J o h n / ) ;
938- expect ( output . includes ( '\x1b[2m' ) ) . toBe ( true ) ;
936+ expect ( output ) . toContain ( ' Enter name' ) ;
937+ expect ( output ) . toContain ( 'John' ) ;
939938 expect ( answers ) . toEqual ( { q1 : 'bar' } ) ;
940939 writeSpy . mockRestore ( ) ;
941940 } ) ;
@@ -957,8 +956,8 @@ describe('inquirer.prompt(...)', () => {
957956 ] ) ;
958957
959958 const output = writeSpy . mock . calls . map ( ( [ text ] ) => text ) . join ( '' ) ;
960- expect ( output ) . toMatch ( / E n t e r a g e . * 2 5 / ) ;
961- expect ( output . includes ( '\x1b[2m' ) ) . toBe ( true ) ;
959+ expect ( output ) . toContain ( ' Enter age' ) ;
960+ expect ( output ) . toContain ( '25' ) ;
962961 expect ( answers ) . toEqual ( { q1 : 'bar' } ) ;
963962 writeSpy . mockRestore ( ) ;
964963 } ) ;
0 commit comments