測試Vue的filters方法:javascript
局部:java
import Page from '../src/Page' it('filter', () => { const case = Page.filters.toLowerCase('HI') expect(case).toBe('hi') })
全局:測試
Vue.options.filters.toLowerCase('HI').toBe('hi')在其餘測試頁面中只需引入filter便可eg: import {toLowerCase} from 'filters/index'