Skip to content

Commit

Permalink
Ignore path differences in TS error message
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbranch committed Sep 18, 2018
1 parent 80a28cd commit fe888e2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/comparison-tests/create-and-execute-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,10 @@ function getNormalisedFileContent(file, location) {
.replace(/(\(dist[\/|\\]\w*.js:)(\d*)(:)(\d*)(\))/g, function(match, openingBracketPathAndColon, lineNumber, colon, columnNumber, closingBracket){
return openingBracketPathAndColon + 'irrelevant-line-number' + colon + 'irrelevant-column-number' + closingBracket;
})
// Ignore path differences in TS error output
.replace(/(TS6305:[^']+')([^']+?)([^\\\/']+')([^']+')([^']+?)([^\\\/']+'.*)$/gm, function(match, messageStart, outputFileBaseDir, outputFileName, messageMiddle, sourceFileBaseDir, sourceFileName) {
return messageStart + outputFileName + messageMiddle + sourceFileName;
})
: normaliseString(originalContent))
// Ignore 'at C:/source/ts-loader/dist/index.js:90:19' style row number / column number differences
.replace(/at (.*)(dist[\/|\\]\w*.js:)(\d*)(:)(\d*)/g, function(match, spaceAndStartOfPath, remainingPathAndColon, lineNumber, colon, columnNumber){
Expand Down

0 comments on commit fe888e2

Please sign in to comment.