File tree 2 files changed +32
-0
lines changed 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow
8
+ */
9
+
10
+ import { resolve } from 'path' ;
11
+
12
+ import { run } from '../Utils' ;
13
+
14
+ const dir = resolve ( __dirname , '..' , 'run-programatically' ) ;
15
+
16
+ test ( 'run Jest programatically' , ( ) => {
17
+ const { stdout} = run ( `node index.js --version` , dir ) ;
18
+ expect ( stdout ) . toMatch ( / \d { 2 } \. \d { 1 , 2 } \. \d { 1 , 2 } [ \- \S ] * - d e v $ / ) ;
19
+ } ) ;
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ *
8
+ * @flow
9
+ */
10
+
11
+ // Running Jest like this is not officially supported,
12
+ // but it is common practice until there is a proper API as a substitute.
13
+ require ( 'jest' ) . run ( process . argv ) ;
You can’t perform that action at this time.
0 commit comments