1
- ' use strict' ;
1
+ " use strict" ;
2
2
/**
3
3
* @license
4
4
* Copyright 2020 Google LLC
14
14
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
* See the License for the specific language governing permissions and
16
16
* limitations under the License.
17
- */ exports . __esModule = true ;
18
- var yargs = require ( 'yargs' ) ;
19
- var path_1 = require ( 'path' ) ;
20
- var child_process_promise_1 = require ( 'child-process-promise' ) ;
21
- var argv = yargs . options ( {
22
- main : { type : 'string' , demandOption : true } ,
23
- emulator : { type : 'boolean' } ,
24
- persistence : { type : 'boolean' }
25
- } ) . argv ;
26
- var nyc = path_1 . resolve ( __dirname , '../../../node_modules/.bin/nyc' ) ;
27
- var mocha = path_1 . resolve ( __dirname , '../../../node_modules/.bin/mocha' ) ;
28
- process . env . TS_NODE_CACHE = 'NO' ;
29
- process . env . TS_NODE_COMPILER_OPTIONS = '{"module":"commonjs"}' ;
30
- var args = [
31
- mocha ,
32
- '--require' ,
33
- 'ts-node/register' ,
34
- '--require' ,
35
- argv . main ,
36
- '--config' ,
37
- '../../config/mocharc.node.js'
38
- ] ;
39
- if ( argv . emulator ) {
40
- process . env . FIRESTORE_EMULATOR_PORT = '8080' ;
41
- process . env . FIRESTORE_EMULATOR_PROJECT_ID = 'test-emulator' ;
42
- }
43
- if ( argv . persistence ) {
44
- process . env . USE_MOCK_PERSISTENCE = 'YES' ;
45
- args . push ( '--require' , 'test/util/node_persistence.ts' ) ;
46
- }
47
- args = args . concat ( argv . _ ) ;
48
- var childProcess = child_process_promise_1 . spawn ( nyc , args , {
49
- stdio : 'inherit' ,
50
- cwd : process . cwd ( )
51
- } ) . childProcess ;
52
- process . once ( 'exit' , function ( ) {
53
- return childProcess . kill ( ) ;
54
- } ) ;
55
- process . once ( 'SIGINT' , function ( ) {
56
- return childProcess . kill ( 'SIGINT' ) ;
57
- } ) ;
58
- process . once ( 'SIGTERM' , function ( ) {
59
- return childProcess . kill ( 'SIGTERM' ) ;
60
- } ) ;
17
+ */ exports . __esModule = true ; var yargs = require ( "yargs" ) ; var path_1 = require ( "path" ) ; var child_process_promise_1 = require ( "child-process-promise" ) ; var argv = yargs . options ( { main :{ type :"string" , demandOption :true } , emulator :{ type :"boolean" } , persistence :{ type :"boolean" } } ) . argv ; var nyc = path_1 . resolve ( __dirname , "../../../node_modules/.bin/nyc" ) ; var mocha = path_1 . resolve ( __dirname , "../../../node_modules/.bin/mocha" ) ; process . env . TS_NODE_CACHE = "NO" ; process . env . TS_NODE_COMPILER_OPTIONS = '{"module":"commonjs"}' ; var args = [ mocha , "--require" , "ts-node/register" , "--require" , argv . main , "--config" , "../../config/mocharc.node.js" ] ; if ( argv . emulator ) { process . env . FIRESTORE_EMULATOR_PORT = "8080" ; process . env . FIRESTORE_EMULATOR_PROJECT_ID = "test-emulator" } if ( argv . persistence ) { process . env . USE_MOCK_PERSISTENCE = "YES" ; args . push ( "--require" , "test/util/node_persistence.ts" ) } args = args . concat ( argv . _ ) ; var childProcess = child_process_promise_1 . spawn ( nyc , args , { stdio :"inherit" , cwd :process . cwd ( ) } ) . childProcess ; process . once ( "exit" , ( function ( ) { return childProcess . kill ( ) } ) ) ; process . once ( "SIGINT" , ( function ( ) { return childProcess . kill ( "SIGINT" ) } ) ) ; process . once ( "SIGTERM" , ( function ( ) { return childProcess . kill ( "SIGTERM" ) } ) ) ;
0 commit comments