Esempio n. 1
0
        it('Should show the parent function.', () => {
            const options = {
                logLevel: 'debug',
                stringifyByDefault: false,
                showLogLevel: false,
                showMethodName: true,
                separator: '|',
                showConsoleColors: false,
            }
            Vue.use({install}, options)

            new Vue({
                created () {
                    this.foo()
                },
                template: '<bar></bar>',
                methods: {
                    foo () {
                        this.$log.fatal('first level call.')
                        externalFunction()
                    }
                }
            })

            function externalFunction () {
                Vue.$log.fatal('calling external function.')
            }
        })
Esempio n. 2
0
 it('install() should work with the correct params.', () => {
     const options = {
         logLevel: 'debug',
         stringifyByDefault: false,
         showLogLevel: false,
         showMethodName: false,
         separator: '|',
         showConsoleColors: true,
     }
     Vue.use({install}, options)
     expect(Vue.$log).to.be.a('object')
     expect(Vue.$log.debug).to.be.a('function')
     expect(Vue.$log.info).to.be.a('function')
     expect(Vue.$log.warn).to.be.a('function')
     expect(Vue.$log.error).to.be.a('function')
     expect(Vue.$log.fatal).to.be.a('function')
 })