Skip to content

Commit 9a2fc92

Browse files
committed
Use default(y) prettier values
1 parent 7bdc9fb commit 9a2fc92

24 files changed

+60
-65
lines changed

.prettierrc.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
module.exports = {
2-
bracketSpacing: true,
3-
printWidth: 80,
42
proseWrap: 'always',
53
semi: false,
6-
singleQuote: true,
7-
tabWidth: 2,
8-
trailingComma: 'es5',
9-
useTabs: false,
4+
singleQuote: true
105
}

jest.config.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ module.exports = {
22
moduleDirectories: ['node_modules', 'src'],
33
moduleFileExtensions: ['js', 'vue'],
44
moduleNameMapper: {
5-
'@testing-library/vue': '<rootDir>/src/vue-testing-library.js',
5+
'@testing-library/vue': '<rootDir>/src/vue-testing-library.js'
66
},
77
coverageDirectory: './coverage',
88
collectCoverageFrom: [
99
'**/src/**/*.js',
1010
'!**/tests/__tests__/**',
11-
'!**/node_modules/**',
11+
'!**/node_modules/**'
1212
],
1313
testPathIgnorePatterns: [
1414
'/node_modules/',
1515
'<rootDir>/dist/',
16-
'<rootDir>/tests/__tests__/components/',
16+
'<rootDir>/tests/__tests__/components/'
1717
],
1818
transform: {
1919
'^.+\\.js$': '<rootDir>/node_modules/babel-jest',
20-
'.*\\.(vue)$': '<rootDir>/node_modules/vue-jest',
20+
'.*\\.(vue)$': '<rootDir>/node_modules/vue-jest'
2121
},
22-
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
22+
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue']
2323
}

src/vue-testing-library.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
getQueriesForElement,
55
prettyDOM,
66
wait,
7-
fireEvent,
7+
fireEvent
88
} from '@testing-library/dom'
99

1010
const mountedWrappers = new Set()
@@ -28,7 +28,7 @@ function render(
2828
const VueRouter = require('vue-router')
2929
localVue.use(VueRouter)
3030
router = new VueRouter({
31-
routes,
31+
routes
3232
})
3333
}
3434

@@ -47,7 +47,7 @@ function render(
4747
store: vuexStore,
4848
attachToDocument: true,
4949
sync: false,
50-
...mountOptions,
50+
...mountOptions
5151
})
5252

5353
mountedWrappers.add(wrapper)
@@ -70,7 +70,7 @@ function render(
7070
wrapper.setProps(_)
7171
return wait()
7272
},
73-
...getQueriesForElement(wrapper.element.parentNode),
73+
...getQueriesForElement(wrapper.element.parentNode)
7474
}
7575
}
7676

tests/__mocks__/axios.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
get: jest.fn(() => Promise.resolve({ data: {} })),
2+
get: jest.fn(() => Promise.resolve({ data: {} }))
33
}

tests/__tests__/components/Button.vue

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@ export default {
77
props: {
88
text: {
99
type: String,
10-
default: '',
10+
default: ''
1111
},
1212
type: {
1313
validator: value => ['primary', 'secondary'].includes(value),
14-
default: 'primary',
15-
},
14+
default: 'primary'
15+
}
1616
},
1717
computed: {
1818
typeClass: function() {
1919
if (this.type) {
2020
return `button button--${this.type}`
2121
}
2222
return 'button'
23-
},
23+
}
2424
},
2525
methods: {
2626
handleClick(e) {
2727
this.$emit('click')
28-
},
29-
},
28+
}
29+
}
3030
}
3131
</script>

tests/__tests__/components/EndToEnd.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ export default {
2323
return {
2424
loading: true,
2525
data: {
26-
returnedMessage: null,
27-
},
26+
returnedMessage: null
27+
}
2828
}
2929
},
3030
async mounted() {
3131
const data = await fetchAMessage()
3232
this.loading = false
3333
this.data = data
34-
},
34+
}
3535
}
3636
</script>

tests/__tests__/components/Fetch.vue

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ export default {
1616
props: {
1717
url: {
1818
type: String,
19-
required: true,
20-
},
19+
required: true
20+
}
2121
},
2222
data() {
2323
return {
24-
data: null,
24+
data: null
2525
}
2626
},
2727
methods: {
2828
fetch() {
2929
axios.get(this.url).then(response => {
3030
this.data = response.data
3131
})
32-
},
33-
},
32+
}
33+
}
3434
}
3535
</script>

tests/__tests__/components/Form.vue

+5-5
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ export default {
5858
review: '',
5959
rating: '1',
6060
genre: 'Comedy',
61-
recommend: false,
61+
recommend: false
6262
}
6363
},
6464
computed: {
6565
submitDisabled() {
6666
return !this.title || !this.review
67-
},
67+
}
6868
},
6969
methods: {
7070
submit() {
@@ -75,9 +75,9 @@ export default {
7575
review: this.review,
7676
rating: this.rating,
7777
genre: this.genre,
78-
recommend: this.recommend,
78+
recommend: this.recommend
7979
})
80-
},
81-
},
80+
}
81+
}
8282
}
8383
</script>

tests/__tests__/components/NumberDisplay.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ export default {
1212
props: {
1313
number: {
1414
type: Number,
15-
required: true,
16-
},
15+
required: true
16+
}
1717
},
1818
data() {
1919
return {
20-
id: idCounter++,
20+
id: idCounter++
2121
}
22-
},
22+
}
2323
}
2424
</script>

tests/__tests__/components/StopWatch.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default {
1313
return {
1414
running: false,
1515
lapse: 0,
16-
timer: null,
16+
timer: null
1717
}
1818
},
1919
beforeDestroy() {
@@ -32,7 +32,7 @@ export default {
3232
}
3333
3434
this.running = !this.running
35-
},
36-
},
35+
}
36+
}
3737
}
3838
</script>

tests/__tests__/components/Store/VuexTest.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ import { mapActions, mapState } from 'vuex'
1414
1515
export default {
1616
computed: {
17-
...mapState(['count']),
17+
...mapState(['count'])
1818
},
1919
2020
methods: {
21-
...mapActions(['decrement', 'increment']),
22-
},
21+
...mapActions(['decrement', 'increment'])
22+
}
2323
}
2424
</script>
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
export const store = {
22
state: {
3-
count: 0,
3+
count: 0
44
},
55
actions: {
66
increment: ({ commit, state }) => commit('SET_COUNT', state.count + 1),
7-
decrement: ({ commit, state }) => commit('SET_COUNT', state.count - 1),
7+
decrement: ({ commit, state }) => commit('SET_COUNT', state.count - 1)
88
},
99
mutations: {
1010
SET_COUNT: (state, count) => {
1111
state.count = count
12-
},
13-
},
12+
}
13+
}
1414
}

tests/__tests__/components/Stubs.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ import VButton from './Button'
1111
1212
export default {
1313
name: 'SearchForm',
14-
components: { VButton },
14+
components: { VButton }
1515
}
1616
</script>

tests/__tests__/components/Validate.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
export default {
3131
data: () => ({
3232
username: '',
33-
password: '',
34-
}),
33+
password: ''
34+
})
3535
}
3636
</script>

tests/__tests__/components/queries/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ export {
1717
JestHelpers,
1818
Placeholder,
1919
TotallyEmptyLabel,
20-
LabelWithNoFormControl,
20+
LabelWithNoFormControl
2121
}

tests/__tests__/fetch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import 'jest-dom/extend-expect'
66
test('Fetch makes an API call and displays the greeting when load-greeting is clicked', async () => {
77
axiosMock.get.mockImplementationOnce(() =>
88
Promise.resolve({
9-
data: { greeting: 'hello there' },
9+
data: { greeting: 'hello there' }
1010
})
1111
)
1212

tests/__tests__/form.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ test('Review form submits', async () => {
88
review: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
99
rating: '3',
1010
genre: 'Action',
11-
recommend: true,
11+
recommend: true
1212
}
1313

1414
const {
@@ -17,7 +17,7 @@ test('Review form submits', async () => {
1717
getByTestId,
1818
getByDisplayValue,
1919
getByPlaceholderText,
20-
emitted,
20+
emitted
2121
} = render(Form)
2222

2323
const submitButton = getByText('Submit')

tests/__tests__/number-display.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import 'jest-dom/extend-expect'
44

55
test('calling render with the same component but different props does not remount', async () => {
66
const { queryByTestId, updateProps } = render(NumberDisplay, {
7-
props: { number: 1 },
7+
props: { number: 1 }
88
})
99
expect(queryByTestId('number-display')).toHaveTextContent('1')
1010

tests/__tests__/router/programmatic-routing/components/Home.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default {
1010
methods: {
1111
goToAbout() {
1212
this.$router.push('/about')
13-
},
14-
},
13+
}
14+
}
1515
}
1616
</script>

tests/__tests__/router/programmatic-routing/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { render, fireEvent } from '@testing-library/vue'
99
const routes = [
1010
{ path: '/', component: Home },
1111
{ path: '/about', component: About },
12-
{ path: '*', redirect: '/about' },
12+
{ path: '*', redirect: '/about' }
1313
]
1414

1515
test('navigating programmatically', async () => {

tests/__tests__/simple-button.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ afterEach(cleanup)
66
test('renders button with text', () => {
77
const buttonText = "Click me; I'm sick"
88
const { getByText } = render(SimpleButton, {
9-
props: { text: buttonText },
9+
props: { text: buttonText }
1010
})
1111

1212
getByText(buttonText)
@@ -15,7 +15,7 @@ test('renders button with text', () => {
1515
test('click event is emitted when button is clicked', () => {
1616
const text = 'Click me'
1717
const { getByText, emitted } = render(SimpleButton, {
18-
props: { text },
18+
props: { text }
1919
})
2020
fireEvent.click(getByText(text))
2121
expect(emitted().click).toHaveLength(1)

tests/__tests__/stubs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ afterEach(cleanup)
55

66
test('Form contains search button', () => {
77
const { getByText } = render(Stubs, {
8-
stubs: ['FontAwesomeIcon'],
8+
stubs: ['FontAwesomeIcon']
99
})
1010
getByText('Search now')
1111
})

tests/__tests__/vue-router.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { cleanup, render, fireEvent } from '@testing-library/vue'
99
const routes = [
1010
{ path: '/', component: Home },
1111
{ path: '/about', component: About },
12-
{ path: '*', redirect: '/about' },
12+
{ path: '*', redirect: '/about' }
1313
]
1414

1515
afterEach(cleanup)

tests/__tests__/vuex.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ test('can render with vuex with defaults', async () => {
2828

2929
test('can render with vuex with custom initial state', async () => {
3030
const { getByTestId, getByText } = renderVuexTestComponent({
31-
state: { count: 3 },
31+
state: { count: 3 }
3232
})
3333
await fireEvent.click(getByText('-'))
3434

0 commit comments

Comments
 (0)