Skip to content

Commit cd647b8

Browse files
committed
test setup
1 parent 3357fbb commit cd647b8

File tree

5 files changed

+41
-4
lines changed

5 files changed

+41
-4
lines changed

.eslintrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
"globals": {
66
"define": true,
77
"Vue": true,
8-
"Firebase": true
8+
"Firebase": true,
9+
"describe": true,
10+
"it": true,
11+
"expect": true
912
},
1013
"plugins": [
1114
"html"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.DS_Store
22
node_modules
3+
coverage

karma.conf.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = function (config) {
2+
config.set({
3+
frameworks: ['jasmine'],
4+
browsers: ['PhantomJS'],
5+
reporters: ['progress', 'coverage'],
6+
files: [
7+
'node_modules/vue/dist/vue.js',
8+
'src/*.js',
9+
'tests/*.js'
10+
],
11+
preprocessors: {
12+
'src/*.js': 'coverage'
13+
},
14+
coverageReporter: {
15+
reporters: [
16+
{ type: 'html', subdir: '.' },
17+
{ type: 'text-summary' }
18+
]
19+
}
20+
})
21+
}

package.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"description": "Firebase bindings for Vue.js",
55
"main": "src/vuefire.js",
66
"scripts": {
7-
"lint": "eslint src tests examples --ext js,html",
8-
"test": "echo \"Error: no test specified\" && exit 1"
7+
"lint": "eslint --ext=js,html src tests examples karma.conf.js",
8+
"test": "npm run lint && karma start karma.conf.js --single-run"
99
},
1010
"repository": {
1111
"type": "git",
@@ -25,6 +25,13 @@
2525
"homepage": "https://github.com/firebase/vuefire#readme",
2626
"devDependencies": {
2727
"eslint": "^1.10.3",
28-
"eslint-plugin-html": "^1.1.0"
28+
"eslint-plugin-html": "^1.1.0",
29+
"jasmine-core": "^2.4.1",
30+
"karma": "^0.13.19",
31+
"karma-coverage": "^0.5.3",
32+
"karma-jasmine": "^0.3.6",
33+
"karma-phantomjs-launcher": "^0.2.3",
34+
"phantomjs": "^1.9.19",
35+
"vue": "^1.0.13"
2936
}
3037
}

tests/vuefire.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
describe('VueFire', function () {
2+
it('should pass', function () {
3+
expect(1).toBe(1)
4+
})
5+
})

0 commit comments

Comments
 (0)