File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 11const { message} = require ( "danger" )
22const { readFileSync, existsSync} = require ( "fs" )
3+ const parseDiff = require ( "parse-diff" )
34
45const diffPath = "./TypeScript/baseline-changes.diff"
56if ( existsSync ( diffPath ) ) {
67 const diffContents = readFileSync ( diffPath , "utf8" )
7- message ( diffContents )
8+ const diffedFiles = parseDiff ( diffContents )
9+
10+ const uninterestingFiles = [ ".generated.d.ts" , "globalThisBlockscopedProperties.types" , "mappedTypeRecursiveInference.types" ]
11+ const withoutKnownNormalFails = diffedFiles . filter ( diff => {
12+ return uninterestingFiles . filter ( suffix => diff . to ?. endsWith ( suffix ) ) . length > 0
13+ } )
14+
15+ const md = [ "## Changed baselines from the TypeScript test suite" ]
16+
17+ withoutKnownNormalFails . forEach ( diff => {
18+ md . push ( `#### ${ diff . to || diff . from } }` )
19+
20+ md . push ( "```diff" )
21+ diff . chunks . forEach ( chunk => {
22+ md . push ( chunk . content )
23+ } )
24+ md . push ( "```" )
25+ } )
26+
27+
28+ message ( md . join ( "\n" ) )
829}
Original file line number Diff line number Diff line change 1919 "danger" : " ^10.5.4" ,
2020 "jsdom" : " ^16.4.0" ,
2121 "node-fetch" : " ^2.6.1" ,
22+ "parse-diff" : " ^0.7.0" ,
2223 "print-diff" : " ^1.0.0" ,
2324 "styleless-innertext" : " ^1.1.2" ,
2425 "typescript" : " 4.1.0-dev.20200908" ,
You can’t perform that action at this time.
0 commit comments