Skip to content
Permalink
Browse files

added test cases

  • Loading branch information...
saivarunk committed Jan 17, 2017
1 parent d4992b6 commit 25e929cfeb255344dea08fb3023d14fa551295b5
@@ -0,0 +1,9 @@
language: node_js
deploy:
provider: npm
email: saivarunk@gmail.com
api_key:
secure: Okoj2P6BSKXh7KE/VdOF1vt3qI0YkLXPkmGFyzdMeIrJu2mdwCn8INZ70zUN4WDcE2Bz5RSQFlsjfhEPRn8hWkzVsZFwyRS73LeqiIAKjjemGoKkdS06d7A4b/QSVl9W+WlVzDfx4lLYMQVJwsRkRP7IDi5M2FX1QpxHihwmsf1CR3+ZnoGk297lRu+9r4kNiPhAb3b9qQxB364nBGAsSd1L4Sn0zGeUyriGRi4kF2RZoF7EQhHhnjV1Xfez9Els0oTUDckGxAbxZp5ZEMA2d6xAqJKDSEmcPrsqYBRGJOuzAMIS7kBZvM2MEa2ssKBr5IBYJ7ZGAg2NgcxkssqTQrIZSqD+vp2zvX4EfrBUGF00nUhX+CZCUQ3vzGUffa0l/pZDFKZsW0+P/rWNsnv7ewI3LAnZri3qt9U29iQwkFjosE/M2A8xn2usQfFrApnisydW65ZMWvrryUQAO+Iga+aa0yWrgGoo/N/k2yn0WG+G6ZCOH5FNBrnVEacpCrDcdf+WOiGVB/onLVbR9YIFmem460iT2fE7EVIthkr8Ba4nnfNirSenCDZD19M6a8Mat48FfnRPkmlsYLj2cDCURsXwifuV+iCqjaiJ3as9ZoLUrMT3ZqPbDwAo14teVOU3UPvAH195DWv8T723o7z50neAH9hSIA59gwEHGxoOf6I=
on:
tags: false
repo: saivarunk/vue-simple-upload
@@ -2,6 +2,7 @@

[![npm](https://img.shields.io/npm/v/vue-simple-upload.svg) ![npm](https://img.shields.io/npm/dm/vue-simple-upload.svg)](https://www.npmjs.com/package/vue-simple-upload)
[![vue2](https://img.shields.io/badge/vue-2.x-brightgreen.svg)](https://vuejs.org/)
[![Build Status](https://secure.travis-ci.org/saivarunk/vue-simple-upload.png?branch=master)](https://travis-ci.org/saivarunk/vue-simple-upload)

An simple file upload component for vue.js.

@@ -1,13 +1,12 @@
var path = require('path')
var webpack = require('webpack')
// var webpack = require('webpack')

var projectRoot = path.resolve(__dirname, '../')

module.exports = {
entry: './src/',
entry: 'src',
output: {
path: path.resolve(__dirname, '../dist'),
publicPath: '/gh-pages',
filename: 'vue-simple-upload.min.js',
library: 'FileUpload',
libraryTarget: 'umd'
@@ -21,7 +20,7 @@ module.exports = {
}
},
resolveLoader: {
root: path.join(__dirname, 'node_modules'),
root: path.join(__dirname, 'node_modules')
},
module: {
preLoaders: [{
@@ -65,4 +64,4 @@ module.exports = {
noInfo: false
},
devtool: '#eval-source-map'
}
}
@@ -1,6 +1,6 @@
{
"name": "vue-simple-upload",
"version": "0.1.3",
"version": "0.1.4",
"description": "Simple File upload component for Vue.js",
"author": "saivarunk@gmail.com",
"repository": {
@@ -14,7 +14,8 @@
],
"scripts": {
"start": "webpack-dev-server --inline --config build/webpack.base.conf.js",
"build": "cross-env NODE_ENV=production webpack --config build/webpack.min.conf.js"
"build": "cross-env NODE_ENV=production webpack --config build/webpack.min.conf.js",
"test": "karma start test/unit/karma.conf.js --single-run"
},
"main": "dist/vue-simple-upload.min.js",
"dependencies": {
@@ -41,18 +42,21 @@
"file-loader": "^0.8.4",
"function-bind": "^1.0.2",
"isparta-loader": "^2.0.0",
"jasmine-core": "^2.5.2",
"json-loader": "^0.5.4",
"karma": "^0.13.15",
"karma": "^1.4.0",
"karma-coverage": "^0.5.5",
"karma-jasmine": "^1.1.0",
"karma-mocha": "^0.2.2",
"karma-phantomjs-launcher": "^1.0.0",
"karma-phantomjs-launcher": "^1.0.2",
"karma-sinon-chai": "^1.2.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "0.0.24",
"karma-webpack": "^1.7.0",
"karma-webpack": "^2.0.1",
"lolex": "^1.4.0",
"mocha": "^2.4.5",
"ora": "^0.2.0",
"phantomjs": "^2.1.7",
"phantomjs-prebuilt": "^2.1.3",
"sinon": "^1.17.3",
"sinon-chai": "^2.8.0",
@@ -65,4 +69,4 @@
"webpack-dev-server": "^1.12.0",
"webpack-merge": "^0.8.3"
}
}
}
@@ -10,10 +10,10 @@ export default {
type: String
},
action: {
type: String
type: String,
default: 'POST'
}
},
data () {
return {
file: null
@@ -23,7 +23,7 @@ export default {
emitter (event, data) {
this.$emit(event, data)
},
updateProgress (oEvent) {
uploadProgress (oEvent) {
let vm = this
if (oEvent.lengthComputable) {
let percentComplete = Math.round(oEvent.loaded * 100 / oEvent.total)
@@ -65,7 +65,7 @@ export default {
xhr.onloadend = function (e) {
vm.emitter('finish', e)
}
xhr.upload.onprogress = vm.updateProgress
xhr.upload.onprogress = vm.uploadProgress
xhr.send(formData)
}
}
@@ -0,0 +1,9 @@
{
"env": {
"mocha": true
},
"globals": {
"expect": true,
"sinon": true
}
}
@@ -0,0 +1,213 @@
body, html {
margin:0; padding: 0;
height: 100%;
}
body {
font-family: Helvetica Neue, Helvetica, Arial;
font-size: 14px;
color:#333;
}
.small { font-size: 12px; }
*, *:after, *:before {
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
}
h1 { font-size: 20px; margin: 0;}
h2 { font-size: 14px; }
pre {
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
margin: 0;
padding: 0;
-moz-tab-size: 2;
-o-tab-size: 2;
tab-size: 2;
}
a { color:#0074D9; text-decoration:none; }
a:hover { text-decoration:underline; }
.strong { font-weight: bold; }
.space-top1 { padding: 10px 0 0 0; }
.pad2y { padding: 20px 0; }
.pad1y { padding: 10px 0; }
.pad2x { padding: 0 20px; }
.pad2 { padding: 20px; }
.pad1 { padding: 10px; }
.space-left2 { padding-left:55px; }
.space-right2 { padding-right:20px; }
.center { text-align:center; }
.clearfix { display:block; }
.clearfix:after {
content:'';
display:block;
height:0;
clear:both;
visibility:hidden;
}
.fl { float: left; }
@media only screen and (max-width:640px) {
.col3 { width:100%; max-width:100%; }
.hide-mobile { display:none!important; }
}

.quiet {
color: #7f7f7f;
color: rgba(0,0,0,0.5);
}
.quiet a { opacity: 0.7; }

.fraction {
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
font-size: 10px;
color: #555;
background: #E8E8E8;
padding: 4px 5px;
border-radius: 3px;
vertical-align: middle;
}

div.path a:link, div.path a:visited { color: #333; }
table.coverage {
border-collapse: collapse;
margin: 10px 0 0 0;
padding: 0;
}

table.coverage td {
margin: 0;
padding: 0;
vertical-align: top;
}
table.coverage td.line-count {
text-align: right;
padding: 0 5px 0 20px;
}
table.coverage td.line-coverage {
text-align: right;
padding-right: 10px;
min-width:20px;
}

table.coverage td span.cline-any {
display: inline-block;
padding: 0 5px;
width: 100%;
}
.missing-if-branch {
display: inline-block;
margin-right: 5px;
border-radius: 3px;
position: relative;
padding: 0 4px;
background: #333;
color: yellow;
}

.skip-if-branch {
display: none;
margin-right: 10px;
position: relative;
padding: 0 4px;
background: #ccc;
color: white;
}
.missing-if-branch .typ, .skip-if-branch .typ {
color: inherit !important;
}
.coverage-summary {
border-collapse: collapse;
width: 100%;
}
.coverage-summary tr { border-bottom: 1px solid #bbb; }
.keyline-all { border: 1px solid #ddd; }
.coverage-summary td, .coverage-summary th { padding: 10px; }
.coverage-summary tbody { border: 1px solid #bbb; }
.coverage-summary td { border-right: 1px solid #bbb; }
.coverage-summary td:last-child { border-right: none; }
.coverage-summary th {
text-align: left;
font-weight: normal;
white-space: nowrap;
}
.coverage-summary th.file { border-right: none !important; }
.coverage-summary th.pct { }
.coverage-summary th.pic,
.coverage-summary th.abs,
.coverage-summary td.pct,
.coverage-summary td.abs { text-align: right; }
.coverage-summary td.file { white-space: nowrap; }
.coverage-summary td.pic { min-width: 120px !important; }
.coverage-summary tfoot td { }

.coverage-summary .sorter {
height: 10px;
width: 7px;
display: inline-block;
margin-left: 0.5em;
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
}
.coverage-summary .sorted .sorter {
background-position: 0 -20px;
}
.coverage-summary .sorted-desc .sorter {
background-position: 0 -10px;
}
.status-line { height: 10px; }
/* dark red */
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
.low .chart { border:1px solid #C21F39 }
/* medium red */
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
/* light red */
.low, .cline-no { background:#FCE1E5 }
/* light green */
.high, .cline-yes { background:rgb(230,245,208) }
/* medium green */
.cstat-yes { background:rgb(161,215,106) }
/* dark green */
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
.high .chart { border:1px solid rgb(77,146,33) }
/* dark yellow (gold) */
.medium .chart { border:1px solid #f9cd0b; }
.status-line.medium, .medium .cover-fill { background: #f9cd0b; }
/* light yellow */
.medium { background: #fff4c2; }
/* light gray */
span.cline-neutral { background: #eaeaea; }

.cbranch-no { background: yellow !important; color: #111; }

.cstat-skip { background: #ddd; color: #111; }
.fstat-skip { background: #ddd; color: #111 !important; }
.cbranch-skip { background: #ddd !important; color: #111; }


.cover-fill, .cover-empty {
display:inline-block;
height: 12px;
}
.chart {
line-height: 0;
}
.cover-empty {
background: white;
}
.cover-full {
border-right: none !important;
}
pre.prettyprint {
border: none !important;
padding: 0 !important;
margin: 0 !important;
}
.com { color: #999 !important; }
.ignore-none { color: #999; font-weight: normal; }

.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -48px;
}
.footer, .push {
height: 48px;
}

0 comments on commit 25e929c

Please sign in to comment.
You can’t perform that action at this time.