forked from substantial/atomfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnippets.cson
103 lines (91 loc) · 2.16 KB
/
snippets.cson
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
# '.source.coffee':
# 'Console log':
# 'prefix': 'log'
# 'body': 'console.log $1'
#
# This file uses CoffeeScript Object Notation (CSON).
# If you are unfamiliar with CSON, you can read more about it here:
# https://github.com/bevry/cson#what-is-cson
'.source.js':
'Mocha Describe':
'prefix': 'des'
'body': 'describe(\'$1\', () => {\n $2\n})'
'Mocha Context':
'prefix': 'con'
'body': 'context(\'$1\', () => {\n $2\n})'
'Mocha It':
'prefix': 'it'
'body': 'it(\'$1\', () => {\n $2\n})'
'Mocha beforeEach':
'prefix': 'bef'
'body': 'beforeEach((${1:done}) => {\n $2\n})'
'Mocha afterEach':
'prefix': 'aft'
'body': 'afterEach((${1:done}) => {\n $2\n})'
'React Component':
'prefix': 'rcom'
'body': """
import React from \'react\'
import PropTypes from \'prop-type\'
class $1 extends React.Component {
render () {
return null
}
}
$1.propTypes = {
$2
}
export default $1
"""
'React Functional Component':
'prefix': 'rfcom'
'body': """
import React from \'react\'
import PropTypes from \'prop-types\'
const $1 = () => (
<div>$1</div>
)
$1.propTypes = {
$2
}
export default $1
"""
'React Component Spec':
'prefix': 'rcoms'
'body': """
import React from \'react\'
import { shallow } from \'enzyme\'
import $1 from \'./$1\'
it('renders', () => {
const component = render()
expect(component).not.toEqual(null)
})
function render (props = {}) {
return shallow(<$1 {...props} />)
}
"""
#
# Unity / C-Sharp snippets
#
'.source.cs':
'MonoBehaviour' :
'prefix': 'mono'
'body': """
using UnityEngine;
using System;
using System.Collections.Generic;
using System.Linq;
public class $1 : MonoBehaviour {
$2
}
"""