ssh-client-wrapper 1.0.6 → 1.0.7

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.
@@ -0,0 +1,13 @@
1
+ name: release package
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ tags:
7
+ - 'v*'
8
+ jobs:
9
+ test:
10
+ uses: ./.github/workflows/run_test.yml
11
+ publish-npm:
12
+ uses: ./.github/workflows/npm-publish.yml
13
+ secrets: inherit
@@ -0,0 +1,8 @@
1
+ name: run UT only
2
+ on:
3
+ push:
4
+ tags-ignore:
5
+ - 'v*'
6
+ jobs:
7
+ test:
8
+ uses: ./.github/workflows/run_test.yml
@@ -1,11 +1,7 @@
1
1
  name: publish
2
2
  on:
3
- push:
4
- tags:
5
- - 'v*'
3
+ workflow_call:
6
4
  jobs:
7
- test:
8
- uses: ./.github/workflows/run_test.yml
9
5
  publish-npm:
10
6
  runs-on: ubuntu-latest
11
7
  steps:
@@ -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.6",
3
+ "version": "1.0.7",
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) && git push"
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.calledOnce;
37
- expect(sshout).to.be.calledWith("hoge\n");
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.calledOnce;
43
- expect(sshout).to.be.calledWith("hoge\n");
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)