Skip to content

Commit 847369a

Browse files
committed
Switch to using vue-test-utils
1 parent 20c20e0 commit 847369a

File tree

5 files changed

+1996
-2039
lines changed

5 files changed

+1996
-2039
lines changed

.babelrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"presets": [
3+
["env", {
4+
"targets:": { "node": "stable" }
5+
}]
6+
]
7+
}

karma.conf.js

Lines changed: 0 additions & 59 deletions
This file was deleted.

package.json

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,18 @@
1818
},
1919
"main": "src/laravel-vue-pagination.js",
2020
"scripts": {
21-
"test": "karma start karma.conf.js",
22-
"test-watch": "karma start karma.conf.js --no-single-run"
21+
"test": "jest"
2322
},
2423
"devDependencies": {
25-
"aliasify": "^2.1.0",
26-
"babel-preset-es2015": "^6.18.0",
27-
"babelify": "^7.3.0",
28-
"browserify": "^13.3.0",
29-
"jasmine-core": "^2.5.2",
30-
"karma": "^1.3.0",
31-
"karma-browserify": "^5.1.0",
32-
"karma-jasmine": "^1.1.0",
33-
"karma-phantomjs-launcher": "^1.0.2",
34-
"karma-spec-reporter": "^0.0.26",
35-
"phantomjs-prebuilt": "^2.1.14",
36-
"vue": "^2.1.8",
37-
"watchify": "^3.8.0"
24+
"babel-jest": "^21.2.0",
25+
"babel-preset-env": "^1.6.0",
26+
"jest": "^21.2.1",
27+
"regenerator-runtime": "^0.11.0",
28+
"vue": "^2.4.4",
29+
"vue-template-compiler": "^2.4.4",
30+
"vue-test-utils": "1.0.0-beta"
31+
},
32+
"jest": {
33+
"testMatch": ["**/tests/**/*.js?(x)"]
3834
}
3935
}

test/laravel-vue-pagination.spec.js renamed to tests/laravel-vue-pagination.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
const Vue = require('vue');
2-
const LaravelVuePagination = require('../src/laravel-vue-pagination');
1+
import { mount } from 'vue-test-utils';
2+
import LaravelVuePagination from '../src/laravel-vue-pagination';
33

44
function getComponent(Component, propsData) {
5-
const Ctor = Vue.extend(Component);
6-
return new Ctor({ propsData }).$mount();
5+
const wrapper = mount(Component, { propsData: propsData });
6+
return wrapper.vm;
77
}
88

99
var exampleData = {

0 commit comments

Comments
 (0)