From 1d547500e80439c1564b8399c630b618835407ff Mon Sep 17 00:00:00 2001 From: Hiroyasu Nishiyama Date: Sat, 5 Nov 2022 14:30:32 +0900 Subject: [PATCH] fix watch node test on MacOS/ARM --- test/nodes/core/storage/23-watch_spec.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/nodes/core/storage/23-watch_spec.js b/test/nodes/core/storage/23-watch_spec.js index a9942d5b1..1e10d0e2e 100644 --- a/test/nodes/core/storage/23-watch_spec.js +++ b/test/nodes/core/storage/23-watch_spec.js @@ -15,11 +15,14 @@ **/ var fs = require("fs-extra"); +var os = require("os"); var path = require("path"); var should = require("should"); var helper = require("node-red-node-test-helper"); var watchNode = require("nr-test-utils").require("@node-red/nodes/core/storage/23-watch.js"); +var arch = os.arch(); +var platform = os.platform(); describe('watch Node', function() { this.timeout(5000); @@ -89,7 +92,10 @@ describe('watch Node', function() { msg.should.have.property('payload', result.payload); msg.should.have.property('type', result.type); if('size' in result) { - msg.should.have.property('size', result.size); + if (!((arch != "arm64") && (platform !== "darwin"))) { + // On OSX/ARM, two change events occur and first event do not reflect file size change. So ignore size field in the case. + msg.should.have.property('size', result.size); + } } count++; if(count === len) {