Skip to content

Commit

Permalink
Make coverage work (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
daneah authored Feb 3, 2019
1 parent 79deddf commit 7167253
Show file tree
Hide file tree
Showing 17 changed files with 106 additions and 73 deletions.
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 4
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
presets: [
'@vue/app',
]
],
}
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module.exports = {
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)',
],
testURL: 'http://localhost/',
collectCoverage: true,
collectCoverageFrom: [
'**/*.vue',
],
Expand Down
9 changes: 6 additions & 3 deletions src/components/BaseButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ export default {
text: {
type: String,
required: false,
default: 'Submit'
}
}
default: 'Submit',
},
},
data () {
return {}
},
}
</script>

Expand Down
9 changes: 6 additions & 3 deletions src/components/BaseHeading.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ export default {
level: {
required: false,
default: 1,
type: Number
}
}
type: Number,
},
},
data () {
return {}
},
}
</script>

Expand Down
15 changes: 9 additions & 6 deletions src/components/BaseLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,27 @@ export default {
props: {
href: {
type: String,
required: true
required: true,
},
external: {
type: Boolean,
required: false,
default: true
default: true,
},
clean: {
type: Boolean,
required: false,
default: false
default: false,
}
},
computed: {
rel () {
return this.external ? 'noopener noindex nofollow' : false;
}
}
return this.external ? 'noopener noindex nofollow' : false
},
},
data () {
return {}
},
}
</script>

Expand Down
13 changes: 8 additions & 5 deletions src/components/BaseNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,28 @@
</template>

<script>
import BaseLink from '@/components/BaseLink';
import BaseLink from '@/components/BaseLink'
export default {
name: 'BaseNav',
components: {
BaseLink
BaseLink,
},
props: {
links: {
type: Array,
required: true
required: true,
}
},
computed: {
activeLinks () {
const currentRoute = this.$route.name
return this.links.filter(link => link.to !== currentRoute)
}
}
},
},
data () {
return {}
},
}
</script>

Expand Down
17 changes: 10 additions & 7 deletions src/components/BaseParagraph.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@

<script>
export default {
name: 'BaseParagraph',
props: {
lead: {
type: Boolean,
default: false
}
}
name: 'BaseParagraph',
props: {
lead: {
type: Boolean,
default: false,
},
},
data () {
return {}
},
}
</script>

Expand Down
27 changes: 15 additions & 12 deletions src/components/BookAnnouncement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,22 @@ import BaseParagraph from '@/components/BaseParagraph'
import ResponsiveImage from '@/components/ResponsiveImage'
export default {
name: 'BookAnnouncement',
components: {
BaseHeading,
BaseLink,
BaseParagraph,
ResponsiveImage,
},
computed: {
dealAvailable () {
const rightNow = new Date()
return rightNow.getMonth() === 0 || (rightNow.getMonth() === 1 && rightNow.getDate() <= 7)
},
name: 'BookAnnouncement',
components: {
BaseHeading,
BaseLink,
BaseParagraph,
ResponsiveImage,
},
computed: {
dealAvailable () {
const rightNow = new Date()
return rightNow.getMonth() === 0 || (rightNow.getMonth() === 1 && rightNow.getDate() <= 7)
},
},
data () {
return {}
},
}
</script>

Expand Down
9 changes: 6 additions & 3 deletions src/components/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@
</template>

<script>
import BaseParagraph from '@/components/BaseParagraph';
import BaseParagraph from '@/components/BaseParagraph'
export default {
name: 'Card',
components: {
BaseParagraph
}
BaseParagraph,
},
data () {
return {}
},
}
</script>

Expand Down
11 changes: 7 additions & 4 deletions src/components/NetlifyForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,22 @@ import BaseButton from '@/components/BaseButton'
export default {
name: 'NetlifyForm',
components: {
BaseButton
BaseButton,
},
props: {
formName: {
type: String,
required: true
required: true,
},
submitButtonText: {
type: String,
required: false,
default: 'Submit'
default: 'Submit',
}
}
},
data () {
return {}
},
}
</script>

Expand Down
22 changes: 11 additions & 11 deletions src/components/RadarPlot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,41 +53,41 @@ export default {
levels: {
type: Number,
required: false,
default: 3
default: 3,
},
characteristics: {
type: Array,
required: true
required: true,
},
color: {
type: String,
default: 'var(--blue)'
default: 'var(--blue)',
}
},
data () {
return {
size: 500,
graphicMultiplier: 0.75
graphicMultiplier: 0.75,
}
},
computed: {
radsBetweenAxes () {
return 2 * Math.PI / this.characteristics.length;
return 2 * Math.PI / this.characteristics.length
},
graphicSize () {
return this.size * this.graphicMultiplier;
return this.size * this.graphicMultiplier
},
points () {
let points = [];
let points = []
this.characteristics.forEach((characteristic) => {
let pointX = Math.cos(this.radsForCharacteristic(characteristic)) * this.graphicSize / 2 * (characteristic.score / this.levels),
pointY = Math.sin(this.radsForCharacteristic(characteristic)) * this.graphicSize / 2 * (characteristic.score / this.levels);
pointY = Math.sin(this.radsForCharacteristic(characteristic)) * this.graphicSize / 2 * (characteristic.score / this.levels)
points.push(`${pointX},${pointY}`);
points.push(`${pointX},${pointY}`)
});
return points.join(" ");
}
return points.join(" ")
},
},
methods: {
radsForCharacteristic (characteristic) {
Expand Down
11 changes: 7 additions & 4 deletions src/components/ResponsiveImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ export default {
props: {
src: {
type: String,
required: true
required: true,
},
alt: {
type: String,
required: true
}
}
required: true,
},
},
data () {
return {}
},
}
</script>

Expand Down
7 changes: 5 additions & 2 deletions src/components/Timeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,17 @@ export default {
name: 'Timeline',
components: {
BaseParagraph,
ResponsiveImage
ResponsiveImage,
},
props: {
entries: {
type: Array,
required: true,
}
}
},
data () {
return {}
},
}
</script>

Expand Down
7 changes: 5 additions & 2 deletions src/components/YouTubeEmbed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ export default {
props: {
videoId: {
type: String,
required: true
required: true,
}
}
},
data () {
return {}
},
}
</script>

Expand Down
6 changes: 3 additions & 3 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ Vue.use(VueAnalytics, {
router,
debug: {
enabled: process.env.NODE_ENV !== 'production',
sendHitTask: process.env.NODE_ENV === 'production'
}
sendHitTask: process.env.NODE_ENV === 'production',
},
})

new Vue({
router,
store,
render: h => h(App)
render: h => h(App),
}).$mount('#app')
10 changes: 5 additions & 5 deletions vue.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const path = require('path');
const PrerenderSpaPlugin = require('prerender-spa-plugin');
const path = require('path')
const PrerenderSpaPlugin = require('prerender-spa-plugin')

const productionPlugins = [
new PrerenderSpaPlugin({
Expand All @@ -12,13 +12,13 @@ const productionPlugins = [
'/talks',
],
}),
];
]

module.exports = {
lintOnSave: false,
configureWebpack: (config) => {
if (process.env.NODE_ENV === 'production') {
config.plugins.push(...productionPlugins);
config.plugins.push(...productionPlugins)
}
},
};
}

0 comments on commit 7167253

Please sign in to comment.