-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/npm_and_yarn/test/typescript-5.4.2
- Loading branch information
Showing
107 changed files
with
1,000 additions
and
940 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,53 @@ | ||
const fs = require( 'fs' ) | ||
const { extractModuleLineAndColumn } = require('mocha-json-streamier-reporter/lib/parse-stack-trace') | ||
var core = require('@actions/core'); | ||
var { issueCommand } = require('@actions/core/lib/command'); | ||
const fs = require( 'fs' ); | ||
const { | ||
extractModuleLineAndColumn | ||
} = require( 'mocha-json-streamier-reporter/lib/parse-stack-trace' ); | ||
const core = require( '@actions/core' ); | ||
const { issueCommand } = require( '@actions/core/lib/command' ); | ||
|
||
const suiteName = process.argv[2]; | ||
const suiteName = process.argv[ 2 ]; | ||
|
||
if( suiteName ) { | ||
return; | ||
if ( suiteName ) { | ||
return; | ||
} | ||
|
||
const filePath = `../../test/suites/${suiteName}/results/result.json`; | ||
|
||
var resultObject = {}; | ||
|
||
if (fs.existsSync(filePath)) { | ||
resultObject = JSON.parse(fs.readFileSync(filePath, 'utf8'))[suiteName]; | ||
|
||
if (resultObject.fail.length != 0) { | ||
|
||
resultObject.fail.forEach(test => { | ||
const error = extractModuleLineAndColumn(test.error.stack); | ||
let filePath = ''; | ||
if( error.file ) { | ||
filePath = error.file.replace('/usr/src/app/', 'test/'); | ||
} | ||
const message = test.fullTitle + ": " + test.error.message; | ||
|
||
issueCommand('error', { | ||
file: filePath, | ||
line: error.line, | ||
col: error.column | ||
}, message); | ||
}); | ||
|
||
} else { | ||
resultObject.pass.forEach(test => { | ||
core.info( 'OK: ' + test.fullTitle ); | ||
}); | ||
|
||
resultObject.skip.forEach(test => { | ||
core.warning( 'SKIP: ' + test.fullTitle ); | ||
}); | ||
|
||
core.info('\u001b[1mAll good 👍') | ||
} | ||
const filePath = `../../test/suites/${ suiteName }/results/result.json`; | ||
|
||
let resultObject = {}; | ||
|
||
if ( fs.existsSync( filePath ) ) { | ||
resultObject = JSON.parse( fs.readFileSync( filePath, 'utf8' ) )[ suiteName ]; | ||
|
||
if ( resultObject.fail.length != 0 ) { | ||
resultObject.fail.forEach( ( test ) => { | ||
const error = extractModuleLineAndColumn( test.error.stack ); | ||
let filePath = ''; | ||
if ( error.file ) { | ||
filePath = error.file.replace( '/usr/src/app/', 'test/' ); | ||
} | ||
const message = test.fullTitle + ': ' + test.error.message; | ||
|
||
issueCommand( | ||
'error', | ||
{ | ||
file: filePath, | ||
line: error.line, | ||
col: error.column | ||
}, | ||
message | ||
); | ||
} ); | ||
} else { | ||
resultObject.pass.forEach( ( test ) => { | ||
core.info( 'OK: ' + test.fullTitle ); | ||
} ); | ||
|
||
resultObject.skip.forEach( ( test ) => { | ||
core.warning( 'SKIP: ' + test.fullTitle ); | ||
} ); | ||
|
||
core.info( '\u001b[1mAll good 👍' ); | ||
} | ||
} else { | ||
core.error('No tests executed!'); | ||
core.error( 'No tests executed!' ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name: 🧪 Build and Test main | |
on: | ||
push: | ||
branches: | ||
- "main" | ||
- main | ||
|
||
jobs: | ||
_: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.