@@ -34,8 +34,8 @@ module.exports =
34
34
/******/ // the startup function
35
35
/******/ function startup ( ) {
36
36
/******/ // Load entry module and return exports
37
- /******/ return __webpack_require__ ( 226 ) ;
38
- /******/ }
37
+ /******/ return __webpack_require__ ( 660 ) ;
38
+ /******/ } ;
39
39
/******/
40
40
/******/ // run startup
41
41
/******/ return startup ( ) ;
@@ -57,7 +57,7 @@ module.exports = require("child_process");
57
57
58
58
/***/ } ) ,
59
59
60
- /***/ 151 :
60
+ /***/ 226 :
61
61
/***/ ( function ( __unusedmodule , exports , __webpack_require__ ) {
62
62
63
63
"use strict" ;
@@ -72,7 +72,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
72
72
} ) ;
73
73
} ;
74
74
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
75
- const command_1 = __webpack_require__ ( 176 ) ;
75
+ const command_1 = __webpack_require__ ( 358 ) ;
76
76
const os = __webpack_require__ ( 87 ) ;
77
77
const path = __webpack_require__ ( 622 ) ;
78
78
/**
@@ -259,7 +259,7 @@ exports.getState = getState;
259
259
260
260
/***/ } ) ,
261
261
262
- /***/ 176 :
262
+ /***/ 358 :
263
263
/***/ ( function ( __unusedmodule , exports , __webpack_require__ ) {
264
264
265
265
"use strict" ;
@@ -332,69 +332,7 @@ function escape(s) {
332
332
333
333
/***/ } ) ,
334
334
335
- /***/ 226 :
336
- /***/ ( function ( __unusedmodule , __unusedexports , __webpack_require__ ) {
337
-
338
- const core = __webpack_require__ ( 151 )
339
- const exec = __webpack_require__ ( 857 )
340
-
341
- const SCOPE_DSN = 'SCOPE_DSN'
342
-
343
- const DEFAULT_COMMAND =
344
- 'npm test -- --testRunner=@undefinedlabs/scope-agent/jestTestRunner --runner=@undefinedlabs/scope-agent/jestRunner --setupFilesAfterEnv=@undefinedlabs/scope-agent/jestSetupTests'
345
-
346
- async function run ( ) {
347
- try {
348
- const command = core . getInput ( 'command' ) || DEFAULT_COMMAND
349
- const dsn = core . getInput ( 'dsn' ) || process . env [ SCOPE_DSN ]
350
-
351
- if ( ! dsn ) {
352
- throw Error ( 'Cannot find the Scope DSN' )
353
- }
354
-
355
- let apiEndpoint , apiKey
356
- try {
357
- const { username, origin } = new URL ( dsn )
358
- apiEndpoint = origin
359
- apiKey = username
360
- } catch ( e ) { }
361
-
362
- if ( ! apiEndpoint || ! apiKey ) {
363
- throw Error ( 'SCOPE_DSN does not have the correct format' )
364
- }
365
-
366
- console . log ( `Command: ${ command } ` )
367
- if ( dsn ) {
368
- console . log ( `DSN has been set.` )
369
- }
370
-
371
- await exec . exec ( 'npm install --save-dev @undefinedlabs/scope-agent' , null , {
372
- ignoreReturnCode : true ,
373
- } )
374
-
375
- return ExecScopeRun ( command , apiEndpoint , apiKey )
376
- } catch ( error ) {
377
- core . setFailed ( error . message )
378
- }
379
- }
380
-
381
- function ExecScopeRun ( command = DEFAULT_COMMAND , apiEndpoint , apiKey ) {
382
- return exec . exec ( command , null , {
383
- env : {
384
- ...process . env ,
385
- SCOPE_API_ENDPOINT : apiEndpoint ,
386
- SCOPE_APIKEY : apiKey ,
387
- SCOPE_AUTO_INSTRUMENT : true ,
388
- } ,
389
- } )
390
- }
391
-
392
- run ( )
393
-
394
-
395
- /***/ } ) ,
396
-
397
- /***/ 448 :
335
+ /***/ 541 :
398
336
/***/ ( function ( __unusedmodule , exports , __webpack_require__ ) {
399
337
400
338
"use strict" ;
@@ -989,7 +927,75 @@ module.exports = require("path");
989
927
990
928
/***/ } ) ,
991
929
992
- /***/ 857 :
930
+ /***/ 660 :
931
+ /***/ ( function ( __unusedmodule , __unusedexports , __webpack_require__ ) {
932
+
933
+ const core = __webpack_require__ ( 226 )
934
+ const exec = __webpack_require__ ( 730 )
935
+
936
+ const SCOPE_DSN = 'SCOPE_DSN'
937
+
938
+ const DEFAULT_ARGUMENTS = [
939
+ '--' ,
940
+ '--testRunner=@undefinedlabs/scope-agent/jestTestRunner' ,
941
+ '--runner=@undefinedlabs/scope-agent/jestRunner' ,
942
+ '--setupFilesAfterEnv=@undefinedlabs/scope-agent/jestSetupTests' ,
943
+ ]
944
+
945
+ const DEFAULT_COMMAND = 'npm test'
946
+
947
+ async function run ( ) {
948
+ try {
949
+ const command = core . getInput ( 'command' ) || DEFAULT_COMMAND
950
+ const dsn = core . getInput ( 'dsn' ) || process . env [ SCOPE_DSN ]
951
+
952
+ if ( ! dsn ) {
953
+ throw Error ( 'Cannot find the Scope DSN' )
954
+ }
955
+
956
+ let apiEndpoint , apiKey
957
+ try {
958
+ const { username, origin } = new URL ( dsn )
959
+ apiEndpoint = origin
960
+ apiKey = username
961
+ } catch ( e ) { }
962
+
963
+ if ( ! apiEndpoint || ! apiKey ) {
964
+ throw Error ( 'SCOPE_DSN does not have the correct format' )
965
+ }
966
+
967
+ console . log ( `Command: ${ command } ` )
968
+ if ( dsn ) {
969
+ console . log ( `DSN has been set.` )
970
+ }
971
+
972
+ await exec . exec ( 'npm install --save-dev @undefinedlabs/scope-agent' , null , {
973
+ ignoreReturnCode : true ,
974
+ } )
975
+
976
+ return ExecScopeRun ( command , apiEndpoint , apiKey )
977
+ } catch ( error ) {
978
+ core . setFailed ( error . message )
979
+ }
980
+ }
981
+
982
+ function ExecScopeRun ( command = DEFAULT_COMMAND , apiEndpoint , apiKey ) {
983
+ return exec . exec ( command , DEFAULT_ARGUMENTS , {
984
+ env : {
985
+ ...process . env ,
986
+ SCOPE_API_ENDPOINT : apiEndpoint ,
987
+ SCOPE_APIKEY : apiKey ,
988
+ SCOPE_AUTO_INSTRUMENT : true ,
989
+ } ,
990
+ } )
991
+ }
992
+
993
+ run ( )
994
+
995
+
996
+ /***/ } ) ,
997
+
998
+ /***/ 730 :
993
999
/***/ ( function ( __unusedmodule , exports , __webpack_require__ ) {
994
1000
995
1001
"use strict" ;
@@ -1004,7 +1010,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
1004
1010
} ) ;
1005
1011
} ;
1006
1012
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
1007
- const tr = __webpack_require__ ( 448 ) ;
1013
+ const tr = __webpack_require__ ( 541 ) ;
1008
1014
/**
1009
1015
* Exec a command.
1010
1016
* Output will be streamed to the live console.
0 commit comments