Skip to content

test: add test for component that uses JSX #142

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 1 commit into from
Jan 6, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion e2e/__projects__/babel-config/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
presets: ['@babel/preset-env']
presets: ['@babel/preset-env'],
plugins: ['transform-vue-jsx']
}
7 changes: 7 additions & 0 deletions e2e/__projects__/babel-config/components/Jsx.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script>
export default {
render(h) {
return <div />
}
}
</script>
3 changes: 3 additions & 0 deletions e2e/__projects__/babel-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"@babel/preset-env": "^7.2.3",
"@vue/test-utils": "^1.0.0-beta.28",
"babel-core": "^7.0.0-bridge.0",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-vue-jsx": "^3.7.0",
"jest": "^23.6.0",
"node-sass": "^4.11.0",
"vue-jest": "file:../../../"
Expand Down
6 changes: 6 additions & 0 deletions e2e/__projects__/babel-config/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import Less from './components/Less.vue'
import PostCss from './components/PostCss.vue'
import Pug from './components/Pug.vue'
import PugRelative from './components/PugRelativeExtends.vue'
import Jsx from './components/Jsx.vue'

test('processes .vue files', () => {
const wrapper = mount(Basic)
Expand Down Expand Up @@ -57,6 +58,11 @@ test('generates source maps using src attributes', () => {
expect(code).toMatchSnapshot()
})

test('processes .vue file using jsx', () => {
const wrapper = mount(Jsx)
expect(wrapper.vm).toBeTruthy()
})

test('processes .vue file with lang set to coffee', () => {
const wrapper = mount(Coffee)
expect(wrapper.vm).toBeTruthy()
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy