Skip to content

Move to kcd-scripts #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Aug 18, 2019
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,9 @@
"presets": [
["@babel/env", {
"modules": "commonjs",
"targets": {
"node": "current",
"browsers": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
}]
],
"plugins": [
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-transform-runtime"
]
}
23 changes: 5 additions & 18 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
ecmaVersion: 2017,
sourceType: 'module'
},
env: {
browser: true,
jest: true
},
extends: [
'standard',
'./node_modules/kcd-scripts/eslint.js',
'plugin:vue/recommended',
'eslint:recommended',
'prettier/vue',
'plugin:prettier/recommended'
],
plugins: [
'vue'
],
plugins: ['vue'],
rules: {
'no-console': 'off'
}
'no-console': 'off',
'import/no-unresolved': 'off',
},
}
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

<!-- Thanks for your interest in the project. We appreciate bugs filed and PRs submitted! -->
Expand All @@ -30,12 +29,15 @@ Steps to reproduce the behavior:
<!-- Please try to provide a working demo using Codesandbox, a GitHub repo or similar! -->

**Expected behavior**

<!-- A clear and concise description of what you expected to happen. -->

**Screenshots**

<!-- If applicable, add screenshots to help explain your problem. -->

**Related information:**

- `@testing-library/vue` version:
- `Vue` version:
- `node` version:
Expand All @@ -47,4 +49,5 @@ Relevant code or config (if any)
```

**Additional context**

<!-- Add any other context about the problem here. -->
4 changes: 2 additions & 2 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
proseWrap: 'always',
semi: false,
singleQuote: true
}
singleQuote: true,
}
9 changes: 3 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
sudo: false
language: node_js
cache:
yarn: true
directories:
- ~/.npm
notifications:
Expand All @@ -10,10 +9,8 @@ node_js:
- '8'
- '10'
- '12'
install: yarn
script:
- yarn test
- yarn global add codecov
after_success: codecov
install: npm install
script: npm run validate
after_success: kcd-scripts travis-after-success
branches:
only: master
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,25 +72,25 @@ You may also be interested in installing `jest-dom` so you can use
<script>
export default {
data: () => ({
count: 0
count: 0,
}),
methods: {
increment() {
this.count++
}
}
},
},
}
</script>
```

```js
// TestComponent.spec.js
import { render, fireEvent } from '@testing-library/vue'
import {render, fireEvent} from '@testing-library/vue'
import TestComponent from './TestComponent.vue'

test('increments value on click', async () => {
// The render method returns a collection of utilities to query your component.
const { getByText } = render(TestComponent)
const {getByText} = render(TestComponent)

// getByText returns the first matching node for the provided text, and
// throws an error if no elements match or if more than one match is found.
Expand Down
30 changes: 14 additions & 16 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
module.exports = {
moduleDirectories: ['node_modules', 'src'],
const merge = require('lodash.merge')
const config = require('kcd-scripts/jest')

module.exports = merge(config, {
testEnvironment: 'jsdom',
moduleFileExtensions: ['js', 'vue'],
moduleNameMapper: {
'@testing-library/vue': '<rootDir>/src/vue-testing-library.js'
'@testing-library/vue': '<rootDir>/src/vue-testing-library.js',
},
coverageDirectory: './coverage',
collectCoverageFrom: [
'**/src/**/*.js',
'!**/tests/__tests__/**',
'!**/node_modules/**'
],
testPathIgnorePatterns: [
'/node_modules/',
'<rootDir>/dist/',
'<rootDir>/tests/__tests__/components/'
],
collectCoverageFrom: ['**/src/**/*.js', '!**/src/__tests__/**'],
transform: {
'^.+\\.js$': '<rootDir>/node_modules/babel-jest',
'.*\\.(vue)$': '<rootDir>/node_modules/vue-jest'
'.*\\.(vue)$': '<rootDir>/node_modules/vue-jest',
},
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue']
}
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
testPathIgnorePatterns: [
'<rootDir>/node_modules',
'<rootDir>/src/__tests__/components',
],
})
Loading