11/* eslint-disable max-lines-per-function */
22const { assert } = require ( 'chai' ) ;
33const sinon = require ( 'sinon' ) ;
4+ const path = require ( 'path' ) ;
45const Plugin = require ( '../../index' ) ;
56
67function setupSinon ( ) {
@@ -116,7 +117,7 @@ describe('sentry-cli', function() {
116117 plugin . beforeHook ( this . context ) ;
117118 plugin . configure ( this . context ) ;
118119
119- assert . equal ( plugin . readConfig ( 'assetsDir' ) , 'my-dest-dir/ assets' ) ;
120+ assert . equal ( plugin . readConfig ( 'assetsDir' ) , path . join ( 'my-dest-dir' , ' assets') ) ;
120121 } ) ;
121122
122123 it ( 'revisionKey' , function ( ) {
@@ -158,10 +159,7 @@ describe('sentry-cli', function() {
158159 plugin . didPrepare ( ) ;
159160
160161 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` ) ;
165163 } ) ;
166164
167165 it ( 'sets related commits' , function ( ) {
@@ -173,10 +171,7 @@ describe('sentry-cli', function() {
173171 plugin . didPrepare ( ) ;
174172
175173 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` ) ;
180175 } ) ;
181176
182177 it ( 'uploads source maps' , function ( ) {
@@ -188,10 +183,7 @@ describe('sentry-cli', function() {
188183 plugin . didPrepare ( ) ;
189184
190185 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' ) } ` ) ;
195187 } ) ;
196188
197189 it ( 'saves release' , function ( ) {
@@ -203,10 +195,7 @@ describe('sentry-cli', function() {
203195 plugin . didPrepare ( ) ;
204196
205197 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` ) ;
210199 } ) ;
211200 } ) ;
212201
@@ -220,10 +209,7 @@ describe('sentry-cli', function() {
220209 plugin . didDeploy ( ) ;
221210
222211 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` ) ;
227213 } ) ;
228214 } ) ;
229215
@@ -237,10 +223,7 @@ describe('sentry-cli', function() {
237223 plugin . didFail ( ) ;
238224
239225 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` ) ;
244227 } ) ;
245228 } ) ;
246229} ) ;
0 commit comments