1
1
/* eslint-disable max-lines-per-function */
2
2
const { assert } = require ( 'chai' ) ;
3
3
const sinon = require ( 'sinon' ) ;
4
+ const path = require ( 'path' ) ;
4
5
const Plugin = require ( '../../index' ) ;
5
6
6
7
function setupSinon ( ) {
@@ -116,7 +117,7 @@ describe('sentry-cli', function() {
116
117
plugin . beforeHook ( this . context ) ;
117
118
plugin . configure ( this . context ) ;
118
119
119
- assert . equal ( plugin . readConfig ( 'assetsDir' ) , 'my-dest-dir/ assets' ) ;
120
+ assert . equal ( plugin . readConfig ( 'assetsDir' ) , path . join ( 'my-dest-dir' , ' assets') ) ;
120
121
} ) ;
121
122
122
123
it ( 'revisionKey' , function ( ) {
@@ -158,10 +159,7 @@ describe('sentry-cli', function() {
158
159
plugin . didPrepare ( ) ;
159
160
160
161
this . sinon . assert . calledWithExactly ( stub ,
161
- 'SENTRY_ORG=my-org ' +
162
- 'SENTRY_PROJECT=my-project ' +
163
- 'SENTRY_AUTH_TOKEN=my-auth-token ' +
164
- 'node_modules/.bin/sentry-cli releases new my-project@v1.0.0@1234567' ) ;
162
+ `${ path . join ( 'node_modules' , '.bin' , 'sentry-cli' ) } --auth-token my-auth-token releases --org my-org --project my-project new my-project@v1.0.0@1234567` ) ;
165
163
} ) ;
166
164
167
165
it ( 'sets related commits' , function ( ) {
@@ -173,10 +171,7 @@ describe('sentry-cli', function() {
173
171
plugin . didPrepare ( ) ;
174
172
175
173
this . sinon . assert . calledWithExactly ( stub ,
176
- 'SENTRY_ORG=my-org ' +
177
- 'SENTRY_PROJECT=my-project ' +
178
- 'SENTRY_AUTH_TOKEN=my-auth-token ' +
179
- 'node_modules/.bin/sentry-cli releases set-commits --auto my-project@v1.0.0@1234567' ) ;
174
+ `${ path . join ( 'node_modules' , '.bin' , 'sentry-cli' ) } --auth-token my-auth-token releases --org my-org --project my-project set-commits --auto my-project@v1.0.0@1234567` ) ;
180
175
} ) ;
181
176
182
177
it ( 'uploads source maps' , function ( ) {
@@ -188,10 +183,7 @@ describe('sentry-cli', function() {
188
183
plugin . didPrepare ( ) ;
189
184
190
185
this . sinon . assert . calledWithExactly ( stub ,
191
- 'SENTRY_ORG=my-org ' +
192
- 'SENTRY_PROJECT=my-project ' +
193
- 'SENTRY_AUTH_TOKEN=my-auth-token ' +
194
- 'node_modules/.bin/sentry-cli releases files my-project@v1.0.0@1234567 upload-sourcemaps --rewrite my-dest-dir/assets' ) ;
186
+ `${ path . join ( 'node_modules' , '.bin' , 'sentry-cli' ) } --auth-token my-auth-token releases --org my-org --project my-project files my-project@v1.0.0@1234567 upload-sourcemaps --rewrite ${ path . join ( 'my-dest-dir' , 'assets' ) } ` ) ;
195
187
} ) ;
196
188
197
189
it ( 'saves release' , function ( ) {
@@ -203,10 +195,7 @@ describe('sentry-cli', function() {
203
195
plugin . didPrepare ( ) ;
204
196
205
197
this . sinon . assert . calledWithExactly ( stub ,
206
- 'SENTRY_ORG=my-org ' +
207
- 'SENTRY_PROJECT=my-project ' +
208
- 'SENTRY_AUTH_TOKEN=my-auth-token ' +
209
- 'node_modules/.bin/sentry-cli releases finalize my-project@v1.0.0@1234567' ) ;
198
+ `${ path . join ( 'node_modules' , '.bin' , 'sentry-cli' ) } --auth-token my-auth-token releases --org my-org --project my-project finalize my-project@v1.0.0@1234567` ) ;
210
199
} ) ;
211
200
} ) ;
212
201
@@ -220,10 +209,7 @@ describe('sentry-cli', function() {
220
209
plugin . didDeploy ( ) ;
221
210
222
211
this . sinon . assert . calledWithExactly ( stub ,
223
- 'SENTRY_ORG=my-org ' +
224
- 'SENTRY_PROJECT=my-project ' +
225
- 'SENTRY_AUTH_TOKEN=my-auth-token ' +
226
- 'node_modules/.bin/sentry-cli releases deploys my-project@v1.0.0@1234567 new -e my-production' ) ;
212
+ `${ path . join ( 'node_modules' , '.bin' , 'sentry-cli' ) } --auth-token my-auth-token releases --org my-org --project my-project deploys my-project@v1.0.0@1234567 new -e my-production` ) ;
227
213
} ) ;
228
214
} ) ;
229
215
@@ -237,10 +223,7 @@ describe('sentry-cli', function() {
237
223
plugin . didFail ( ) ;
238
224
239
225
this . sinon . assert . calledWithExactly ( stub ,
240
- 'SENTRY_ORG=my-org ' +
241
- 'SENTRY_PROJECT=my-project ' +
242
- 'SENTRY_AUTH_TOKEN=my-auth-token ' +
243
- 'node_modules/.bin/sentry-cli releases delete my-project@v1.0.0@1234567' ) ;
226
+ `${ path . join ( 'node_modules' , '.bin' , 'sentry-cli' ) } --auth-token my-auth-token releases --org my-org --project my-project delete my-project@v1.0.0@1234567` ) ;
244
227
} ) ;
245
228
} ) ;
246
229
} ) ;
0 commit comments