diff --git a/package-lock.json b/package-lock.json index 75e7b9d..7afe5b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8391,6 +8391,23 @@ "async-limiter": "~1.0.0" } }, + "xstream": { + "version": "11.10.0", + "resolved": "https://registry.npmjs.org/xstream/-/xstream-11.10.0.tgz", + "integrity": "sha512-jzFCiRqGtrJi2S1/RPxVFgJwWVBzy4suMPBXlhOi0BJC7VvsXgo2yOHWnOasnj24n2Dlj2Mgfl6fJXPOYmpHFA==", + "dev": true, + "requires": { + "symbol-observable": "1.2.0" + }, + "dependencies": { + "symbol-observable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", + "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==", + "dev": true + } + } + }, "xtend": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", diff --git a/package.json b/package.json index 003709f..e6d63ba 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,8 @@ }, "devDependencies": { "cypress": "3.1.5", - "semantic-release": "15.13.3" + "semantic-release": "15.13.3", + "xstream": "11.10.0" }, "repository": { "type": "git", diff --git a/page/index.html b/page/index.html index e9d8502..49fdb91 100644 --- a/page/index.html +++ b/page/index.html @@ -1,5 +1,5 @@
to be watched by the tests... 3
+to be watched by the tests... 2
diff --git a/plugins.js b/plugins.js index eeb78a4..ace8fdb 100644 --- a/plugins.js +++ b/plugins.js @@ -30,6 +30,44 @@ if (options && typeof options.watch === 'string') { client.send(text) } }) + + client.onclose = () => { + console.log('client closing connection ✋') + } + client.onerror = e => { + console.error('WS client error', e) + } + + const stdoutWrite = process.stdout.write.bind(process.stdout) + process.stdout.write = what => { + if (typeof what === 'string') { + console.error('wrote stdout') + client.send( + JSON.stringify({ + command: 'stdout', + message: what + }) + ) + } + stdoutWrite.call(null, what) + } + // const stderrWrite = process.stderr.write.bind(process.stderr) + // process.stderr.write = what => { + // if (typeof what === 'string') { + // client.send( + // JSON.stringify({ + // command: 'stderr', + // message: what + // }) + // ) + // } + // stderrWrite.call(null, what) + // } + + setTimeout(() => { + console.log('first line is %d', 101) + console.error('but there was an error %s', '😡') + }, 1000) }) } else { console.log( diff --git a/support.js b/support.js index ba5d95d..0594347 100644 --- a/support.js +++ b/support.js @@ -1,28 +1,90 @@ ///