File tree Expand file tree Collapse file tree 4 files changed +85
-3
lines changed Expand file tree Collapse file tree 4 files changed +85
-3
lines changed Original file line number Diff line number Diff line change
1
+ #
2
+ # CI build and test steps. See azure-pipelines.yml for job details.
3
+ #
4
+
5
+ steps :
6
+ - checkout : self
7
+
8
+ # Ensure Node.js 10 is active
9
+ - task : NodeTool@0
10
+ inputs :
11
+ versionSpec : ' 10.x'
12
+ displayName : ' Use Node.js 10'
13
+
14
+ # Ensure Python 2.7 is active
15
+ - task : UsePythonVersion@0
16
+ inputs :
17
+ versionSpec : ' 2.7'
18
+ displayName : ' Use Python 2.7'
19
+
20
+ # Workaround to move repo source files into a "jest" folder (see azure-pipelines.yml for details)
21
+ - script : |
22
+ cd /
23
+ mv $(Build.Repository.LocalPath) $(JEST_DIR)
24
+ mkdir $(Build.Repository.LocalPath)
25
+ displayName : ' Move source into jest folder'
26
+
27
+ # Run yarn to install dependencies and build
28
+ - script : yarn
29
+ workingDirectory : $(JEST_DIR)
30
+ displayName : ' Install dependencies and build'
31
+
32
+ # Run test-ci-partial
33
+ - script : yarn run test-ci-partial
34
+ workingDirectory : $(JEST_DIR)
35
+ displayName : ' Run tests'
36
+
37
+ # Publish CI test results
38
+ - task : PublishTestResults@2
39
+ inputs :
40
+ testResultsFiles : ' **/reports/junit/*.xml'
41
+ searchFolder : $(JEST_DIR)
42
+ testRunTitle : ' CI Tests $(Agent.OS)'
43
+ displayName : ' Publish test results'
44
+ condition : succeededOrFailed()
Original file line number Diff line number Diff line change
1
+ #
2
+ # Azure Pipelines CI configuration for Linux, Windows, and macOS.
3
+ #
4
+
5
+ jobs :
6
+ - job : Linux
7
+ pool :
8
+ vmImage : ubuntu-16.04
9
+ steps :
10
+ - template : .azure-pipelines/ci-steps.yml
11
+
12
+ - job : Windows
13
+ pool :
14
+ vmImage : vs2017-win2016
15
+ steps :
16
+ - script : git config --global core.autocrlf false
17
+ displayName : ' Clone with LF preserved'
18
+
19
+ - script : choco install hg
20
+ displayName : ' Install Mercurial'
21
+
22
+ - template : .azure-pipelines/ci-steps.yml
23
+
24
+ - job : macOS
25
+ pool :
26
+ vmImage : macos-10.13
27
+ steps :
28
+ - script : brew install mercurial
29
+ displayName : ' Install Mercurial'
30
+
31
+ - template : .azure-pipelines/ci-steps.yml
32
+
33
+ variables :
34
+ # Ensures output produced by Jest for certain tests includes ANSI escape characters (needed to match snapshots)
35
+ FORCE_COLOR : 1
36
+ # Default checkout directory is "s", but inline snapshot tests will fail due to assumption that Jest is running under a "jest" folder
37
+ # (see packages/jest-message-util/src/index.js PATH_JEST_PACKAGES)
38
+ JEST_DIR : $(Agent.BuildDirectory)/jest
Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ export const createEmptyPackage = (
137
137
} ;
138
138
139
139
export const extractSummary = ( stdout : string ) => {
140
- const match = stdout . match (
140
+ const match = stdout . replace ( / (?: \\ [ r n ] ) + / g , '\n' ) . match (
141
141
/ T e s t S u i t e s : .* \n T e s t s .* \n S n a p s h o t s .* \n T i m e .* ( \n R a n a l l t e s t s u i t e s ) * .* \n * $ / gm,
142
142
) ;
143
143
if ( ! match ) {
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export default function runJest(
31
31
args ?: Array < string > ,
32
32
options : RunJestOptions = { } ,
33
33
) {
34
- const isRelative = dir [ 0 ] !== '/' ;
34
+ const isRelative = ! path . isAbsolute ( dir ) ;
35
35
36
36
if ( isRelative ) {
37
37
dir = path . resolve ( __dirname , dir ) ;
@@ -101,7 +101,7 @@ export const until = async function(
101
101
text : string ,
102
102
options : RunJestOptions = { } ,
103
103
) {
104
- const isRelative = dir [ 0 ] !== '/' ;
104
+ const isRelative = ! path . isAbsolute ( dir ) ;
105
105
106
106
if ( isRelative ) {
107
107
dir = path . resolve ( __dirname , dir ) ;
You can’t perform that action at this time.
0 commit comments