ssh-client-wrapper 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
name: run UT
|
|
2
2
|
on:
|
|
3
|
-
push:
|
|
4
|
-
branches: [ main ]
|
|
5
|
-
tag-ignore: 'v*'
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [ main ]
|
|
8
|
-
tag-ignore: 'v*'
|
|
9
3
|
workflow_call:
|
|
10
|
-
|
|
11
4
|
jobs:
|
|
12
5
|
test:
|
|
13
6
|
services:
|
|
@@ -22,7 +15,7 @@ jobs:
|
|
|
22
15
|
runs-on: ubuntu-latest
|
|
23
16
|
strategy:
|
|
24
17
|
matrix:
|
|
25
|
-
node-version: [18.x]
|
|
18
|
+
node-version: [18.x, 20.x, 16.x]
|
|
26
19
|
steps:
|
|
27
20
|
- uses: actions/checkout@v3
|
|
28
21
|
- name: Use Node.js ${{ matrix.node-version }}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ssh-client-wrapper",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "wrapper library for open ssh client and rsync",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "mocha --recursive test",
|
|
8
8
|
"lint": "eslint --fix lib test",
|
|
9
|
-
"postversion": "git push origin $(git describe --abbrev=0 --tags)
|
|
9
|
+
"postversion": "git push origin $(git describe --abbrev=0 --tags)"
|
|
10
10
|
},
|
|
11
11
|
"engines": {
|
|
12
12
|
"node": ">=12.9"
|
package/test/sshExec.js
CHANGED
|
@@ -33,14 +33,15 @@ describe("test for ssh execution", function() {
|
|
|
33
33
|
it("should execute single command with stdout", async ()=>{
|
|
34
34
|
const rt = await sshExec(hostInfo, `echo ${testText}`, sshout);
|
|
35
35
|
expect(rt).to.equal(0);
|
|
36
|
-
expect(sshout).to.be.
|
|
37
|
-
|
|
36
|
+
expect(sshout).to.be.called;
|
|
37
|
+
|
|
38
|
+
expect(sshout).to.be.calledWithMatch(/^hoge/);
|
|
38
39
|
});
|
|
39
40
|
it("should execute single command with stderr", async ()=>{
|
|
40
41
|
const rt = await sshExec(hostInfo, `echo ${testText} >&2`, sshout);
|
|
41
42
|
expect(rt).to.equal(0);
|
|
42
|
-
expect(sshout).to.be.
|
|
43
|
-
expect(sshout).to.be.
|
|
43
|
+
expect(sshout).to.be.called;
|
|
44
|
+
expect(sshout).to.be.calledWithMatch(/^hoge/);
|
|
44
45
|
});
|
|
45
46
|
//please note that exec() resolves with non-zero value
|
|
46
47
|
//(126 permisssion deny or 127 file not found)
|