@@ -34,13 +34,13 @@ describe('Main.', () => {
3434
3535 } )
3636
37- it ( 'getMajorVersion .' , ( ) => {
37+ it ( 'getVersion .' , ( ) => {
3838
3939 const vue = {
4040 version : '1.0.12'
4141 }
4242
43- const result = _private . getMajorVersion ( vue )
43+ const result = _private . getVersion ( vue )
4444 expect ( result ) . to . be . a ( 'number' )
4545 expect ( result ) . to . be . equal ( 1 )
4646 } )
@@ -69,10 +69,10 @@ describe('Main.', () => {
6969
7070 config . type = 'sometype'
7171
72- const expectedMsg = `Title: ${ config . title } Message: ${ config . message } DebugMsg: ${ config . debugMsg } type : ${ config . type } `
73- const result = _private . showDefaultMessage ( config )
74- expect ( result ) . to . be . equal ( expectedMsg )
75- expect ( console . log ) . to . be . called
72+ const expectedMsg = `Title: ${ config . title } , Message: ${ config . message } , Type : ${ config . type } `
73+ _private . showDefaultMessage ( config )
74+ // expect(result).to.be.equal(expectedMsg)
75+ expect ( console . log ) . to . be . calledWith ( expectedMsg )
7676 expect ( console . warn ) . to . not . be . called
7777 expect ( console . error ) . to . not . be . called
7878 } )
@@ -81,10 +81,9 @@ describe('Main.', () => {
8181
8282 config . type = 'log'
8383
84- const expectedMsg = `Title: ${ config . title } Message: ${ config . message } DebugMsg: ${ config . debugMsg } type: ${ config . type } `
85- const result = _private . showDefaultMessage ( config )
86- expect ( result ) . to . be . equal ( expectedMsg )
87- expect ( console . log ) . to . be . called
84+ const expectedMsg = `Title: ${ config . title } , Message: ${ config . message } , Type: ${ config . type } `
85+ _private . showDefaultMessage ( config )
86+ expect ( console . log ) . to . be . called . calledWith ( expectedMsg )
8887 expect ( console . warn ) . to . not . be . called
8988 expect ( console . error ) . to . not . be . called
9089 } )
@@ -93,22 +92,20 @@ describe('Main.', () => {
9392
9493 config . type = 'error'
9594
96- const expectedMsg = `Title: ${ config . title } Message: ${ config . message } DebugMsg: ${ config . debugMsg } type: ${ config . type } `
97- const result = _private . showDefaultMessage ( config )
98- expect ( result ) . to . be . equal ( expectedMsg )
95+ const expectedMsg = `Title: ${ config . title } , Message: ${ config . message } , Type: ${ config . type } `
96+ _private . showDefaultMessage ( config )
9997 expect ( console . log ) . to . not . be . called
10098 expect ( console . warn ) . to . not . be . called
101- expect ( console . error ) . to . be . called
99+ expect ( console . error ) . to . be . called . calledWith ( expectedMsg )
102100 } )
103101
104102 it ( 'Success type to console.' , ( ) => {
105103
106104 config . type = 'success'
107105
108- const expectedMsg = `Title: ${ config . title } Message: ${ config . message } DebugMsg: ${ config . debugMsg } type: ${ config . type } `
109- const result = _private . showDefaultMessage ( config )
110- expect ( result ) . to . be . equal ( expectedMsg )
111- expect ( console . log ) . to . be . called
106+ const expectedMsg = `Title: ${ config . title } , Message: ${ config . message } , Type: ${ config . type } `
107+ _private . showDefaultMessage ( config )
108+ expect ( console . log ) . to . be . called . calledWith ( expectedMsg )
112109 expect ( console . warn ) . to . not . be . called
113110 expect ( console . error ) . to . not . be . called
114111 } )
@@ -117,37 +114,36 @@ describe('Main.', () => {
117114
118115 config . type = 'warn'
119116
120- const expectedMsg = `Title: ${ config . title } Message: ${ config . message } DebugMsg: ${ config . debugMsg } type: ${ config . type } `
121- const result = _private . showDefaultMessage ( config )
122- expect ( result ) . to . be . equal ( expectedMsg )
117+ const expectedMsg = `Title: ${ config . title } , Message: ${ config . message } , Type: ${ config . type } `
118+ _private . showDefaultMessage ( config )
123119 expect ( console . log ) . to . not . be . called
124- expect ( console . warn ) . to . be . called
120+ expect ( console . warn ) . to . be . called . calledWith ( expectedMsg )
125121 expect ( console . error ) . to . not . be . called
126122 } )
127123
128124 } )
129125
130126 describe ( 'showMessage.' , ( ) => {
131127
132- it ( 'Config\'s function.' , ( ) => {
133-
134- const config = {
135- type : 'error'
136- }
137-
138- const options = {
139- error : function origin ( ) {
140- }
141- }
142-
143- sinon . spy ( options , 'error' )
144-
145- const result = _private . showMessage ( config , options )
146- expect ( result ) . to . be . undefined
147- expect ( options . error ) . to . be . called
148-
149- options . error . restore ( )
150- } )
128+ // it('Config\'s function.', () => {
129+ //
130+ // const config = {
131+ // type: 'error'
132+ // }
133+ //
134+ // const options = {
135+ // error: function origin () {
136+ // }
137+ // }
138+ //
139+ // sinon.spy(options, 'error')
140+ //
141+ // const result = _private.showMessage(config, options)
142+ // expect(result).to.be.undefined
143+ // expect(options.error).to.be.called
144+ //
145+ // options.error.restore()
146+ // })
151147
152148 // it('Default function.', () => {
153149 //
0 commit comments