Skip to content

Commit 32c5945

Browse files
committed
merge from master
2 parents 45ee54f + f9b42bc commit 32c5945

24 files changed

+4613
-3840
lines changed

.eslintrc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ module.exports = {
2727
// allow async-await
2828
'generator-star-spacing': 0,
2929
'vue/html-closing-bracket-newline': 0,
30-
'vue/html-closing-bracket-spacing': 0,
30+
'vue/singleline-html-element-content-newline': 0,
3131
'vue/multiline-html-element-content-newline': 0,
32-
'vue/singleline-html-element-content-newline': 0
32+
'vue/html-closing-bracket-spacing': 0
3333
}
3434
}

.npmignore

-1
This file was deleted.

.travis.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
sudo: false
22
language: node_js
33
cache:
4+
yarn: true
45
directories:
56
- ~/.npm
67
notifications:
78
email: false
89
node_js: '8'
9-
install: npm install
10-
script: npm run test
11-
after_success: npm run coveralls
10+
install: yarn
11+
script: yarn test
12+
after_success: yarn coveralls
1213
branches:
1314
only: master

README.md

+15-4
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,13 @@ npm install --save-dev vue-testing-library
9999
</template>
100100

101101
// src/TestComponent.spec.js
102+
import 'jest-dom/extend-expect'
102103
import { render } from 'vue-testing-library'
103104
import TestComponent from './TestComponent'
104105

105106
test('should render HelloWorld', () => {
106107
const { queryByTestId } = render(TestComponent)
107-
expect(queryByTestId('test1').textContent).toBe('Hello World')
108+
expect(queryByTestId('test1')).toHaveTextContent('Hello World')
108109
})
109110

110111
```
@@ -115,14 +116,14 @@ The `render` function takes up to 3 parameters and returns an object with some h
115116

116117
1. Component - the Vue component to be tested.
117118
2. RenderOptions - an object containing additional information to be passed to @vue/test-utils mount. This can be:
118-
* props - The component props to be passed to TestComponent
119119
* store - The object definition of a Vuex store, if present `render` will configure a Vuex store and pass to mount.
120120
* routes - A set of routes, if present render will configure VueRouter and pass to mount.
121+
All additional render options are passed to the vue-test-utils mount function in its options.
121122
3. configurationCb - A callback to be called passing the Vue instance when created. This allows 3rd party plugins to be installed prior to mount.
122123

123124
### fireEvent
124125

125-
Lightweight wrapper around DOM element events and methods
126+
Lightweight wrapper around DOM element events and methods. Will call wait, so can be awaited to allow effects to propagate.
126127

127128
### wait
128129

@@ -148,4 +149,14 @@ Feel free to contribute more!
148149

149150
## LICENSE
150151

151-
MIT
152+
MIT
153+
154+
## CONTRIBUTORS
155+
156+
[![dfcook](https://avatars0.githubusercontent.com/u/10348212?v=3&s=200)](https://github.com/dfcook)
157+
[![eunjae-lee](https://avatars0.githubusercontent.com/u/499898?v=3&s=200)](https://github.com/eunjae-lee)
158+
[![tim-maguire](https://avatars0.githubusercontent.com/u/29452317?v=3&s=200)](https://github.com/tim-maguire)
159+
[![samdelacruz](https://avatars0.githubusercontent.com/u/2040007?v=3&s=200)](https://github.com/samdelacruz)
160+
[![ankitsinghaniyaz](https://avatars0.githubusercontent.com/u/11331989?v=3&s=200)](https://github.com/ankitsinghaniyaz)
161+
[![lindgr3n](https://avatars0.githubusercontent.com/u/24882614?v=3&s=200)](https://github.com/lindgr3n)
162+
[![kentcdodds](https://avatars0.githubusercontent.com/u/1500684?v=3&s=200)](https://github.com/kentcdodds)

jest.config.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module.exports = {
2+
moduleDirectories: [
3+
'node_modules',
4+
'src'
5+
],
6+
moduleFileExtensions: [
7+
'js',
8+
'vue'
9+
],
10+
coverageDirectory: './coverage',
11+
collectCoverageFrom: [
12+
'**/src/**/*.js',
13+
'!**/tests/__tests__/**',
14+
'!**/node_modules/**'
15+
],
16+
testPathIgnorePatterns: [
17+
'/node_modules/',
18+
'<rootDir>/npm/',
19+
'<rootDir>/tests/__tests__/components/'
20+
],
21+
transform: {
22+
'^.+\\.js$': '<rootDir>/node_modules/babel-jest',
23+
'.*\\.(vue)$': '<rootDir>/node_modules/vue-jest'
24+
},
25+
snapshotSerializers: [
26+
'<rootDir>/node_modules/jest-serializer-vue'
27+
]
28+
}

0 commit comments

Comments
 (0)