@@ -84,7 +84,7 @@ describe('core', () => {
84
84
const points2 = [
85
85
[ 0 , 0 ] , [ 1000 , 900 ] , [ - 1000 , - 900 ] , [ - 1100 , - 1000 ] , [ 1100 , 1000 ] , [ 10 , 10 ]
86
86
] . map ( ( [ x , y ] ) => new cv . Point ( x , y ) ) ;
87
-
87
+
88
88
const k = 3 ;
89
89
const termCriteria = new cv . TermCriteria ( cv . termCriteria . COUNT , 100 , 0.8 ) ;
90
90
const attempts = 10 ;
@@ -119,12 +119,12 @@ describe('core', () => {
119
119
expect ( ret . centers [ l2 ] . x ) . to . equal ( - 1050 ) ;
120
120
expect ( ret . centers [ l2 ] . y ) . to . equal ( - 950 ) ;
121
121
} ) ;
122
-
122
+
123
123
// related to https://github.com/justadudewhohacks/opencv4nodejs/issues/379
124
124
const points3 = [
125
125
[ 255 , 0 , 0 ] , [ 255 , 0 , 0 ] , [ 255 , 0 , 255 ] , [ 255 , 0 , 255 ] , [ 255 , 255 , 255 ]
126
- ] . map ( ( [ x , y , z ] ) => new cv . Point ( x , y , z ) ) ;
127
-
126
+ ] . map ( ( [ x , y , z ] ) => new cv . Point ( x , y , z ) ) ;
127
+
128
128
it ( 'should return correct centers with Point3' , ( ) => {
129
129
const ret = cv . kmeans ( points3 , k , termCriteria , attempts , flags ) ;
130
130
@@ -144,10 +144,10 @@ describe('core', () => {
144
144
it ( 'should raise error for invalid type' , ( ) => {
145
145
const points3 = [
146
146
[ 255 , 0 , 0 ] , [ 255 , 0 , 0 ] , [ 255 , 0 , 255 ] , [ 255 , 0 , 255 ] , [ 255 , 255 , 255 ]
147
- ] . map ( ( [ x , y , z ] ) => new cv . Vec ( x , y , z ) ) ;
148
-
147
+ ] . map ( ( [ x , y , z ] ) => new cv . Vec ( x , y , z ) ) ;
148
+
149
149
let err ;
150
-
150
+
151
151
try {
152
152
cv . kmeans ( points3 , k , termCriteria , attempts , flags ) ;
153
153
} catch ( e ) {
@@ -157,7 +157,7 @@ describe('core', () => {
157
157
expect ( err . message ) . to . equal ( "Core::Kmeans - expected arg0 to be an Array of Points" ) ;
158
158
} ) ;
159
159
} ) ;
160
-
160
+
161
161
describe ( 'cartToPolar' , ( ) => {
162
162
const x = new cv . Mat ( [ [ 0 , 1 , 100 ] ] , cv . CV_32F ) ;
163
163
const y = new cv . Mat ( [ [ 0 , 1 , 100 ] ] , cv . CV_32F ) ;
@@ -267,7 +267,7 @@ describe('core', () => {
267
267
} ) ;
268
268
} ) ;
269
269
270
- if ( asyncHooks ) {
270
+ if ( asyncHooks && ! process . env . DISABLE_ASYNC_HOOKS_TEST ) {
271
271
describe ( 'async_hooks' , ( ) => {
272
272
it ( 'should trigger `init` callback in async_hooks' , ( ) => {
273
273
let typeFound = false
0 commit comments