diff --git a/.eslintrc b/.eslintrc index 726bf23d7..2941d8837 100644 --- a/.eslintrc +++ b/.eslintrc @@ -3,6 +3,9 @@ "parser": "babel-eslint", "extends": "vue", "plugins": ["flow-vars"], + "env": { + "jasmine": true + }, "rules": { "flow-vars/define-flow-type": 1, "flow-vars/use-flow-type": 1 diff --git a/src/history/abstract.js b/src/history/abstract.js index d17fed5a7..8fe830add 100644 --- a/src/history/abstract.js +++ b/src/history/abstract.js @@ -48,4 +48,8 @@ export class AbstractHistory extends History { this.stack = [this.current] this.index = 0 } + + getLocation () { + return '/' + } } diff --git a/test/unit/specs/history.spec.js b/test/unit/specs/history.spec.js new file mode 100644 index 000000000..f76b5b99c --- /dev/null +++ b/test/unit/specs/history.spec.js @@ -0,0 +1,16 @@ +import { AbstractHistory } from '../../../src/history/abstract' +import VueRouter from '../../../src' + +describe('History', () => { + it('Sets name property on current route', () => { + const router = new VueRouter({ + mode: 'history', + routes: [ + { path: '/', name: 'home', component: {}} + ] + }) + + const history = new AbstractHistory(router) + expect(history.current.name).toBe('home') + }) +})