Skip to content

Commit 077ebf6

Browse files
committed
rjsx-mode snippets
1 parent 15e4b08 commit 077ebf6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+1452
-0
lines changed

snippets/rjsx-mode/.yas-make-groups

Whitespace-only changes.

snippets/rjsx-mode/.yasparents

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
js-mode
2+
js2-mode

snippets/rjsx-mode/GraphQL/expgql

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# -*- mode: snippet -*-
2+
# uuid: ac6e22b0-886b-4a09-861b-c759bfb8fcbe
3+
# contributor: Jimmy Yuen Ho Wong <wyuenho@gmail.com>
4+
# name: exportGraphQL
5+
# key: expgql
6+
# --
7+
8+
export default compose(
9+
graphql(${1:queryOrMutation}, { name: ${2:name} }),
10+
)(${1:${TM_FILENAME_BASE}})
11+

snippets/rjsx-mode/GraphQL/graphql

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# -*- mode: snippet -*-
2+
# uuid: 1a3750bd-8108-40f5-92b4-f0730272815c
3+
# contributor: Jimmy Yuen Ho Wong <wyuenho@gmail.com>
4+
# name: graphQLForComponent
5+
# key: graphql
6+
# --
7+
8+
import { compose, graphql } from 'react-apollo'
9+
10+

snippets/rjsx-mode/Jest/desc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# -*- mode: snippet -*-
2+
# uuid: edfbca80-e069-46cd-a034-b1523e57c4a4
3+
# contributor: Jimmy Yuen Ho Wong <wyuenho@gmail.com>
4+
# name: describeBlock
5+
# key: desc
6+
# --
7+
8+
describe('$1', () => {
9+
$0
10+
})
11+
12+

snippets/rjsx-mode/Jest/snrtest

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# -*- mode: snippet -*-
2+
# uuid: de59c777-b0cb-40b1-903a-a006987fef2e
3+
# contributor: Jimmy Yuen Ho Wong <wyuenho@gmail.com>
4+
# name: setupReactNativeTestWithRedux
5+
# key: snrtest
6+
# --
7+
8+
import 'react-native'
9+
import React from 'react'
10+
import renderer from 'react-test-renderer'
11+
import { Provider } from 'react-redux'
12+
13+
import store from 'src/store'
14+
import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'
15+
16+
describe('<${1:${TM_FILENAME_BASE}} />', () => {
17+
const defaultProps = {}
18+
const wrapper = renderer.create(
19+
<Provider store={store}>
20+
<${1:${TM_FILENAME_BASE}} {...defaultProps} />
21+
</Provider>,
22+
)
23+
24+
test('render', () => {
25+
expect(wrapper).toMatchSnapshot()
26+
})
27+
})
28+
29+

snippets/rjsx-mode/Jest/sntest

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# -*- mode: snippet -*-
2+
# uuid: fae867ad-ec86-4eff-bb90-a9bb07040eb7
3+
# contributor: Jimmy Yuen Ho Wong <wyuenho@gmail.com>
4+
# name: setupReactNativeTest
5+
# key: sntest
6+
# --
7+
8+
import 'react-native'
9+
import React from 'react'
10+
import renderer from 'react-test-renderer'
11+
12+
import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'
13+
14+
describe('<${1:${TM_FILENAME_BASE}} />', () => {
15+
const defaultProps = {}
16+
const wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)
17+
18+
test('render', () => {
19+
expect(wrapper).toMatchSnapshot()
20+
})
21+
})
22+
23+

snippets/rjsx-mode/Jest/srtest

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# -*- mode: snippet -*-
2+
# uuid: 168f89c0-3e0b-4868-b090-50f6fc79d074
3+
# contributor: Jimmy Yuen Ho Wong <wyuenho@gmail.com>
4+
# name: setupReactComponentTestWithRedux
5+
# key: srtest
6+
# --
7+
8+
import React from 'react'
9+
import renderer from 'react-test-renderer'
10+
import { Provider } from 'react-redux'
11+
12+
import store from 'src/store'
13+
import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'
14+
15+
describe('<${1:${TM_FILENAME_BASE}} />', () => {
16+
const defaultProps = {}
17+
const wrapper = renderer.create(
18+
<Provider store={store}>
19+
<${1:${TM_FILENAME_BASE}} {...defaultProps} />
20+
</Provider>,
21+
)
22+
23+
test('render', () => {
24+
expect(wrapper).toMatchSnapshot()
25+
})
26+
})
27+
28+

snippets/rjsx-mode/Jest/stest

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# -*- mode: snippet -*-
2+
# uuid: ddc5cfd4-640f-4fb3-9f85-667de1e4a345
3+
# contributor: Jimmy Yuen Ho Wong <wyuenho@gmail.com>
4+
# name: setupTest
5+
# key: stest
6+
# --
7+
8+
import React from 'react'
9+
import renderer from 'react-test-renderer'
10+
11+
import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'
12+
13+
describe('<${1:${TM_FILENAME_BASE}} />', () => {
14+
const defaultProps = {}
15+
const wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)
16+
17+
test('render', () => {
18+
expect(wrapper).toMatchSnapshot()
19+
})
20+
})
21+
22+

snippets/rjsx-mode/Jest/test

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# -*- mode: snippet -*-
2+
# uuid: 190f78b4-17ec-429e-aaf1-3231726ca580
3+
# contributor: Jimmy Yuen Ho Wong <wyuenho@gmail.com>
4+
# name: testBlock
5+
# key: test
6+
# --
7+
8+
test('should $1', () => {
9+
$0
10+
})
11+
12+

0 commit comments

Comments
 (0)