make_it_so 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b20d622a1f19f90b47cb2843320045304dcb106
|
4
|
+
data.tar.gz: d9b9d64f958cce7b2d077cb79948c922c09e0200
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3a47915eff83ac3273ed7e5c8a7ea659fa3846ac760707931a057c914e6969e340e93732afab5275e1ca6dbff9cd9c448e6c604175455330448033ebe8431de
|
7
|
+
data.tar.gz: 9b9c021ebfcda78790c05b187fffb6f83baaef825fea21f3e935cc5875abbc7556656bc0d1fe9c3da02aa2e9b80a0de80720730ee6d3e85200d69351ce1f5474
|
@@ -95,8 +95,19 @@ module MakeItSo
|
|
95
95
|
|
96
96
|
def jest
|
97
97
|
after_bundle do
|
98
|
-
|
99
|
-
|
98
|
+
deps = [
|
99
|
+
'jest',
|
100
|
+
'babel-jest',
|
101
|
+
'enzyme-adapter-react-15.4',
|
102
|
+
'react-addons-test-utils'
|
103
|
+
]
|
104
|
+
run "yarn add #{deps.join(' ')} --dev"
|
105
|
+
|
106
|
+
run 'mkdir -p spec/javascript/support'
|
107
|
+
inside 'spec/javascript/support' do
|
108
|
+
template 'enzyme.js'
|
109
|
+
end
|
110
|
+
|
100
111
|
modify_json(package_json_file) do |json|
|
101
112
|
json["scripts"] ||= {}
|
102
113
|
json["scripts"]["test"] = "node_modules/.bin/jest"
|
@@ -109,10 +120,25 @@ module MakeItSo
|
|
109
120
|
"moduleDirectories": [
|
110
121
|
"node_modules",
|
111
122
|
"app/javascript"
|
123
|
+
],
|
124
|
+
"setupFiles": [
|
125
|
+
"./spec/javascript/support/enzyme.js"
|
112
126
|
]
|
113
127
|
})
|
114
128
|
end
|
115
129
|
|
130
|
+
modify_json(File.join(destination_root, '.babelrc')) do |json|
|
131
|
+
json["env"] ||= {}
|
132
|
+
json["env"]["test"] ||= {}
|
133
|
+
json["env"]["test"].merge!({
|
134
|
+
"env": {
|
135
|
+
"test": {
|
136
|
+
"presets": ["react", "env"],
|
137
|
+
}
|
138
|
+
}
|
139
|
+
})
|
140
|
+
end
|
141
|
+
|
116
142
|
rake 'yarn:install'
|
117
143
|
end
|
118
144
|
end
|
data/lib/make_it_so/version.rb
CHANGED
@@ -290,4 +290,16 @@ feature 'jest' do
|
|
290
290
|
expect(json["jest"]["moduleDirectories"]).to include("app/javascript")
|
291
291
|
end
|
292
292
|
end
|
293
|
+
|
294
|
+
scenario 'adds a spec/javascript/support/enzyme.js file' do
|
295
|
+
support_file = File.join(app_path, 'spec/javascript/support/enzyme.js')
|
296
|
+
expect(FileTest.exists?(support_file)).to eq(true)
|
297
|
+
end
|
298
|
+
|
299
|
+
scenario 'adds spec/javascript/support/enzyme.js to setup' do
|
300
|
+
in_package_json?(package_json_path) do |json|
|
301
|
+
expect(json["jest"]).to_not be_nil
|
302
|
+
expect(json["jest"]["setupFiles"]).to include('./spec/javascript/support/enzyme.js')
|
303
|
+
end
|
304
|
+
end
|
293
305
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: make_it_so
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Pickett
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -196,6 +196,7 @@ files:
|
|
196
196
|
- templates/rails/spec/features/user_signs_out_spec.rb
|
197
197
|
- templates/rails/spec/features/user_signs_up_spec.rb
|
198
198
|
- templates/rails/spec/javascript/exampleTest.js
|
199
|
+
- templates/rails/spec/javascript/support/enzyme.js
|
199
200
|
- templates/rails/spec/javascript/testHelper.js
|
200
201
|
- templates/rails/spec/support/database_cleaner.rb
|
201
202
|
- templates/rails/spec/support/devise_controller_spec.rb
|