File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4141- script : |
4242 ./scripts/test.sh --tfs "Unit Tests"
4343 displayName : Run Unit Tests
44+ - script : |
45+ yarn test-browser --browser chromium --browser webkit
46+ displayName : Run Unit Tests (Browsers)
4447- script : |
4548 ./scripts/test-integration.sh --tfs "Integration Tests"
4649 displayName : Run Integration Tests
Original file line number Diff line number Diff line change 4949- script : |
5050 DISPLAY=:10 ./scripts/test.sh --tfs "Unit Tests"
5151 displayName : Run Unit Tests
52+ - script : |
53+ DISPLAY=:10 yarn test-browser --browser chromium
54+ displayName : Run Unit Tests (Browser)
5255- script : |
5356 DISPLAY=:10 ./scripts/test-integration.sh --tfs "Integration Tests"
5457 displayName : Run Integration Tests
Original file line number Diff line number Diff line change 4646- powershell : |
4747 .\scripts\test.bat --tfs "Unit Tests"
4848 displayName : Run Unit Tests
49+ - powershell : |
50+ yarn test-browser --browser chromium --browser webkit
51+ displayName : Run Unit Tests (Browser)
4952- powershell : |
5053 .\scripts\test-integration.bat --tfs "Integration Tests"
5154 displayName : Run Integration Tests
Original file line number Diff line number Diff line change 1010 "private" : true ,
1111 "scripts" : {
1212 "test" : " mocha" ,
13+ "test-browser" : " node test/unit/browser/index.js" ,
1314 "preinstall" : " node build/npm/preinstall.js" ,
1415 "postinstall" : " node build/npm/postinstall.js" ,
1516 "compile" : " gulp compile --max_old_space_size=4095" ,
Original file line number Diff line number Diff line change @@ -210,12 +210,22 @@ class EchoRunner extends events.EventEmitter {
210210
211211testModules . then ( async modules => {
212212
213- const browserTypes = Array . isArray ( argv . browser ) ? argv . browser : [ argv . browser ] ;
214- const promises = browserTypes . map ( browserType => runTestsInBrowser ( modules , browserType ) ) ;
215- const messages = await Promise . all ( promises ) ;
213+ // run tests in selected browsers
214+ const browserTypes = Array . isArray ( argv . browser )
215+ ? argv . browser : [ argv . browser ] ;
216+
217+ const promises = browserTypes . map ( async browserType => {
218+ try {
219+ return await runTestsInBrowser ( modules , browserType ) ;
220+ } catch ( err ) {
221+ console . error ( err ) ;
222+ process . exit ( 1 ) ;
223+ }
224+ } ) ;
216225
217226 // aftermath
218227 let didFail = false ;
228+ const messages = await Promise . all ( promises ) ;
219229 for ( let msg of messages ) {
220230 if ( msg ) {
221231 didFail = true ;
You can’t perform that action at this time.
0 commit comments