File tree Expand file tree Collapse file tree 5 files changed +318
-259
lines changed Expand file tree Collapse file tree 5 files changed +318
-259
lines changed Original file line number Diff line number Diff line change 3232 " webworkers"
3333 ],
3434 "devDependencies" : {
35- "@babel/core" : " ^ 7.9.0 " ,
35+ "@babel/core" : " 7.9.6 " ,
3636 "@babel/plugin-proposal-class-properties" : " ^7.8.3" ,
3737 "babel-eslint" : " ^10.1.0" ,
38- "eslint" : " ^6.8.0" ,
39- "eslint-config-bliss" : " ^4.7.0" ,
38+ "eslint" : " 7.0.0" ,
39+ "eslint-config-bliss" : " 5.0.0" ,
40+ "is-ci" : " ^2.0.0" ,
4041 "jasmine-node" : " ^3.0.0" ,
4142 "q" : " ^1.5.1"
4243 },
6768 },
6869 "babel" : {
6970 "presets" : [
70- [" @babel/preset-env" , {
71- "targets" : {
72- "chrome" : " 58" ,
73- "node" : " 10"
71+ [
72+ " @babel/preset-env" ,
73+ {
74+ "targets" : {
75+ "chrome" : " 58" ,
76+ "node" : " 10"
77+ }
7478 }
75- } ]
79+ ]
7680 ]
7781 },
7882 "eslintConfig" : {
Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ describe('API', () => {
242242 } ) ;
243243
244244 p . map ( addOne )
245- . then ( data => data . reduce ( sum ) )
245+ . then ( data => data . reduce ( ( a , b ) => a + b , 0 ) )
246246 . then ( data => {
247247 expect ( data ) . toEqual ( 9 ) ;
248248 done ( ) ;
Original file line number Diff line number Diff line change 1+ const os = require ( 'os' )
2+ const isCI = require ( 'is-ci' )
3+ const isSingleCore = 1 === os . cpus ( ) . length ;
4+
5+ let extraInfo = 'This test is flaky so please rerun. Will be skipped on single core machines and for CI'
6+
7+ if ( isSingleCore ) {
8+ extraInfo += 'This test has been skipped as its running on a single core machine' ;
9+ }
10+
11+ if ( isCI ) {
12+ console . log ( 'This test has been skipped as its running in a CI enviroment' )
13+ }
14+
115describe ( 'Performance' , ( ) => {
216 const isNode = typeof module !== 'undefined' && module . exports ;
317 const Parallel = isNode ? require ( '../../lib/parallel.js' ) : self . Parallel ;
418
5- it ( '.map() should be using multi-threading (could fail on single-core)' , ( ) => {
19+ it ( `.map() should be using multi-threading (${ extraInfo } )` , ( ) => {
20+ if ( isCI || isSingleCore ) {
21+ return ;
22+ }
23+
624 const slowSquare = function ( n ) {
725 let i = 0 ;
826 while ( ++ i < n * n ) { }
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ describe('Q-API', () => {
6666 const p = new Parallel ( [ 1 , 2 , 3 ] ) ;
6767
6868 Q . when ( p . map ( addOne ) )
69- . then ( ( ) => p . spawn ( data => data . reduce ( sum ) ) )
69+ . then ( ( ) => p . spawn ( data => data . reduce ( ( a , b ) => a + b , 0 ) ) )
7070 . then ( data => {
7171 expect ( result ) . toEqual ( 9 ) ;
7272 } ) ;
@@ -90,7 +90,7 @@ describe('Q-API', () => {
9090 const p = new Parallel ( [ 1 , 2 , 3 ] ) ;
9191
9292 Q . when ( p . map ( addOne ) )
93- . then ( qe => p . then ( data => data . reduce ( sum ) ) )
93+ . then ( qe => p . then ( data => data . reduce ( ( a , b ) => a + b , 0 ) ) )
9494 . then ( data => {
9595 expect ( data ) . toEqual ( 9 ) ;
9696 done ( ) ;
You can’t perform that action at this time.
0 commit comments