node-red-contrib-homebridge-automation 0.1.12-beta.9 → 0.2.1-beta.0

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.
Files changed (41) hide show
  1. package/.github/npm-version-script.js +35 -43
  2. package/.github/workflows/Build and Publish.yml +81 -75
  3. package/README.md +7 -4
  4. package/eslint.config.mjs +34 -0
  5. package/package.json +34 -25
  6. package/src/HAP-NodeRed.html +71 -71
  7. package/src/HAP-NodeRed.js +32 -1082
  8. package/src/HapDeviceRoutes.js +59 -0
  9. package/src/hbBaseNode.js +94 -0
  10. package/src/hbConfigNode.js +239 -0
  11. package/src/hbConfigNode.test.js +2179 -0
  12. package/src/hbControlNode.js +77 -0
  13. package/src/hbEventNode.js +23 -0
  14. package/src/hbResumeNode.js +63 -0
  15. package/src/hbStatusNode.js +37 -0
  16. package/test/node-red/.config.nodes.json +453 -0
  17. package/test/node-red/.config.nodes.json.backup +453 -0
  18. package/test/node-red/.config.runtime.json +4 -0
  19. package/test/node-red/.config.runtime.json.backup +3 -0
  20. package/test/node-red/.config.users.json +23 -0
  21. package/test/node-red/.config.users.json.backup +20 -0
  22. package/test/node-red/.flows.json.backup +2452 -0
  23. package/test/node-red/flows.json +2453 -0
  24. package/test/node-red/package.json +6 -0
  25. package/test/node-red/settings.js +593 -0
  26. package/test/node-red/test/node-red/.config.nodes.json +430 -0
  27. package/test/node-red/test/node-red/.config.runtime.json +4 -0
  28. package/test/node-red/test/node-red/.config.runtime.json.backup +3 -0
  29. package/test/node-red/test/node-red/.config.users.json +20 -0
  30. package/test/node-red/test/node-red/.config.users.json.backup +17 -0
  31. package/test/node-red/test/node-red/package.json +6 -0
  32. package/test/node-red/test/node-red/settings.js +593 -0
  33. package/.eslintrc.js +0 -24
  34. package/.nycrc.json +0 -11
  35. package/src/lib/Accessory.js +0 -126
  36. package/src/lib/Characteristic.js +0 -30
  37. package/src/lib/HbAccessories.js +0 -167
  38. package/src/lib/Homebridge.js +0 -71
  39. package/src/lib/Homebridges.js +0 -68
  40. package/src/lib/Service.js +0 -307
  41. package/src/lib/register.js +0 -156
@@ -4,23 +4,25 @@
4
4
  * This scripts queries the npm registry to pull out the latest version for a given tag.
5
5
  */
6
6
 
7
- const fs = require("fs");
8
- const semver = require("semver");
9
- const child_process = require("child_process");
10
- const assert = require("assert");
7
+ const assert = require('node:assert')
8
+ const child_process = require('node:child_process')
9
+ const fs = require('node:fs')
10
+ const process = require('node:process')
11
11
 
12
- const BRANCH_VERSION_PATTERN = /^([A-Za-z]*)-(\d+.\d+.\d+)$/
12
+ const semver = require('semver')
13
+
14
+ const BRANCH_VERSION_PATTERN = /^([A-Z]+)-(\d+\.\d+\.\d+)$/i
13
15
 
14
16
  // Load the contents of the package.json file
15
- const packageJSON = JSON.parse(fs.readFileSync("package.json", "utf8"));
17
+ const packageJSON = JSON.parse(fs.readFileSync('package.json', 'utf8'))
16
18
 
17
- let refArgument = process.argv[2];
18
- let tagArgument = process.argv[3] || "latest";
19
+ const refArgument = process.argv[2]
20
+ const tagArgument = process.argv[3] || 'latest'
19
21
 
20
22
  if (refArgument == null) {
21
- console.error("ref argument is missing");
22
- console.error("Usage: npm-version-script.js <ref> [tag]");
23
- process.exit(1);
23
+ console.error('ref argument is missing')
24
+ console.error('Usage: npm-version-script.js <ref> [tag]')
25
+ process.exit(1)
24
26
  }
25
27
 
26
28
  /**
@@ -30,64 +32,54 @@ if (refArgument == null) {
30
32
  */
31
33
  function getTagVersionFromNpm(tag) {
32
34
  try {
33
- return child_process.execSync(`npm info ${packageJSON.name} version --tag="${tag}"`).toString("utf8").trim();
35
+ return child_process.execSync(`npm info ${packageJSON.name} version --tag="${tag}"`).toString('utf8').trim()
34
36
  } catch (e) {
35
- console.error(`Failed to query the npm registry for the latest version for tag: ${tag}`);
37
+ console.error(`Failed to query the npm registry for the latest version for tag: ${tag}`)
36
38
  // throw e;
37
- return "0.0.0";
39
+ return '0.0.0'
38
40
  }
39
41
  }
40
42
 
41
43
  function desiredTargetVersion(ref) {
42
44
  // ref is a GitHub action ref string
43
- if (ref.startsWith("refs/pull/")) {
44
- throw Error("The version script was executed inside a PR!");
45
+ if (ref.startsWith('refs/pull/')) {
46
+ throw new Error('The version script was executed inside a PR!')
45
47
  }
46
48
 
47
- assert(ref.startsWith("refs/heads/"))
48
- let branchName = ref.slice("refs/heads/".length);
49
+ assert(ref.startsWith('refs/heads/'))
50
+ const branchName = ref.slice('refs/heads/'.length)
49
51
 
50
- let results = branchName.match(BRANCH_VERSION_PATTERN);
52
+ const results = branchName.match(BRANCH_VERSION_PATTERN)
51
53
  if (results != null) {
52
54
  if (results[1] !== tagArgument) {
53
- console.warn(`The base branch name (${results[1]}) differs from the tag name ${tagArgument}`);
55
+ console.warn(`The base branch name (${results[1]}) differs from the tag name ${tagArgument}`)
54
56
  }
55
57
 
56
- return results[2];
57
- }
58
-
59
- // legacy mode were we use the `betaVersion` property in the package.json
60
- if (branchName === "beta" && packageJSON.betaVersion) {
61
- return packageJSON.betaVersion
62
- }
63
-
64
- // legacy mode were we use the `alphaVersion` property in the package.json
65
- if (branchName === "alpha" && packageJSON.alphaVersion) {
66
- return packageJSON.alphaVersion
58
+ return results[2]
67
59
  }
68
60
 
69
- throw new Error(`Malformed branch name for ref: ${ref}. Can't derive the base version. Use a branch name like: beta-x.x.x or alpha-x.x.x`);
61
+ throw new Error(`Malformed branch name for ref: ${ref}. Can't derive the base version. Use a branch name like: beta-x.x.x or alpha-x.x.x`)
70
62
  }
71
63
 
72
64
  // derive the base version from the branch ref
73
- const baseVersion = desiredTargetVersion(refArgument);
65
+ const baseVersion = desiredTargetVersion(refArgument)
74
66
 
75
67
  // query the npm registry for the latest version of the provided tag name
76
- const latestReleasedVersion = getTagVersionFromNpm(tagArgument); // e.g. 0.7.0-beta.12
77
- const latestReleaseBase = semver.inc(latestReleasedVersion, "patch"); // will produce 0.7.0 (removing the preid, needed for the equality check below)
68
+ const latestReleasedVersion = getTagVersionFromNpm(tagArgument) // e.g. 0.7.0-beta.12
69
+ const latestReleaseBase = semver.inc(latestReleasedVersion, 'patch') // will produce 0.7.0 (removing the preid, needed for the equality check below)
78
70
 
79
- let publishTag;
71
+ let publishTag
80
72
  if (semver.eq(baseVersion, latestReleaseBase)) { // check if we are releasing another version for the latest beta or alpha
81
- publishTag = latestReleasedVersion; // set the current latest beta or alpha to be incremented
73
+ publishTag = latestReleasedVersion // set the current latest beta or alpha to be incremented
82
74
  } else {
83
- publishTag = baseVersion; // start of with a new beta or alpha version
75
+ publishTag = baseVersion // start of with a new beta or alpha version
84
76
  }
85
77
 
86
78
  // save the package.json
87
- packageJSON.version = publishTag;
88
- fs.writeFileSync("package.json", JSON.stringify(packageJSON, null, 2));
79
+ packageJSON.version = publishTag
80
+ fs.writeFileSync('package.json', JSON.stringify(packageJSON, null, 2))
89
81
 
90
82
  // perform the same change to the package-lock.json
91
- const packageLockJSON = JSON.parse(fs.readFileSync("package-lock.json", "utf8"));
92
- packageLockJSON.version = publishTag;
93
- fs.writeFileSync("package-lock.json", JSON.stringify(packageLockJSON, null, 2));
83
+ const packageLockJSON = JSON.parse(fs.readFileSync('package-lock.json', 'utf8'))
84
+ packageLockJSON.version = publishTag
85
+ fs.writeFileSync('package-lock.json', JSON.stringify(packageLockJSON, null, 2))
@@ -1,13 +1,14 @@
1
- name: "Build, Publish and Release"
2
-
3
- #
4
- # Automatically publish beta releases on pushes, require a manual workflow action for production releases
5
- #
6
- # Does the following
7
- # 1 - Run the documentation script against the package
8
- # 2 - Create the npm package using the package.json version tag ( or for beta releases, adds a beta tag and increments as needed )
9
- # 3 - Publish the npm package
10
- # 4 - For releases against the main branch, create a github release as well
1
+ name:
2
+ 'Build, Publish and Release'
3
+
4
+ #
5
+ # Automatically publish beta releases on pushes, require a manual workflow action for production releases
6
+ #
7
+ # Does the following
8
+ # 1 - Run the documentation script against the package
9
+ # 2 - Create the npm package using the package.json version tag ( or for beta releases, adds a beta tag and increments as needed )
10
+ # 3 - Publish the npm package
11
+ # 4 - For releases against the latest branch, create a github release as well
11
12
 
12
13
  on:
13
14
  push:
@@ -19,24 +20,24 @@ jobs:
19
20
  runs-on: ubuntu-latest
20
21
 
21
22
  steps:
22
- # checkout repo
23
- - uses: actions/checkout@v4
24
-
25
- # get branch / tag name
26
- - name: Get Branch / Tag Name
27
- id: get_branch
28
- run: |
29
- export BRANCH_NAME=$(if [[ ${GITHUB_REF} =~ "refs/tags/" ]]; then echo ${GITHUB_REF/refs\/tags\//}; else echo ${GITHUB_REF/refs\/heads\//}; fi)
30
- echo $BRANCH_NAME
31
- echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_OUTPUT
32
-
33
- # generate the image tag
34
- - name: Get Image Tag
35
- id: get_tag
36
- run: |
37
- export TARGET_IMAGE_TAG=$(if [ "${{ steps.get_branch.outputs.BRANCH_NAME }}" = "main" ]; then echo "main"; else echo "${{ steps.get_branch.outputs.BRANCH_NAME }}" | awk -F- '{ print $1 }'; fi)
38
- echo $TARGET_IMAGE_TAG
39
- echo "TARGET_IMAGE_TAG=${TARGET_IMAGE_TAG}" >> $GITHUB_OUTPUT
23
+ # checkout repo
24
+ - uses: actions/checkout@v4
25
+
26
+ # get branch / tag name
27
+ - name: Get Branch / Tag Name
28
+ id: get_branch
29
+ run: |
30
+ export BRANCH_NAME=$(if [[ ${GITHUB_REF} =~ "refs/tags/" ]]; then echo ${GITHUB_REF/refs\/tags\//}; else echo ${GITHUB_REF/refs\/heads\//}; fi)
31
+ echo $BRANCH_NAME
32
+ echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_OUTPUT
33
+
34
+ # generate the image tag
35
+ - name: Get Image Tag
36
+ id: get_tag
37
+ run: |
38
+ export TARGET_IMAGE_TAG=$(if [ "${{ steps.get_branch.outputs.BRANCH_NAME }}" = "main" ]; then echo "main"; else echo "${{ steps.get_branch.outputs.BRANCH_NAME }}" | awk -F- '{ print $1 }'; fi)
39
+ echo $TARGET_IMAGE_TAG
40
+ echo "TARGET_IMAGE_TAG=${TARGET_IMAGE_TAG}" >> $GITHUB_OUTPUT
40
41
 
41
42
  outputs:
42
43
  BRANCH_NAME: ${{ steps.get_branch.outputs.BRANCH_NAME }}
@@ -46,50 +47,54 @@ jobs:
46
47
  runs-on: ubuntu-latest
47
48
 
48
49
  steps:
49
- # checkout repo
50
- - uses: actions/checkout@v4
51
- with:
52
- persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
53
- fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
54
-
55
- - uses: actions/setup-node@v4
56
- with:
57
- node-version: lts/*
58
-
59
- - name: Retrieve github-markdown-toc
60
- run: |
61
- wget -q https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc
62
- chmod a+x gh-md-toc
63
-
64
- - name: Create Table of Contents
65
- run: |
66
- npm run-script document --if-present
67
- rm gh-md-toc
68
-
69
- - name: Commit files
70
- run: |
71
- git config --local user.email "github-actions[bot]@users.noreply.github.com"
72
- git config --local user.name "github-actions[bot]"
73
- git add *
74
- git commit -a -m "Update TOC" || true
75
-
76
- - name: Push changes
77
- uses: ad-m/github-push-action@master
78
- with:
79
- github_token: ${{ secrets.GITHUB_TOKEN }}
80
- branch: ${{ github.ref }}
50
+ # checkout repo
51
+ - uses: actions/checkout@v4
52
+ with:
53
+ persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
54
+ fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
55
+
56
+ - uses: actions/setup-node@v4
57
+ with:
58
+ node-version: lts/*
59
+
60
+ - name: Retrieve github-markdown-toc
61
+ run: |
62
+ wget -q https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc
63
+ chmod a+x gh-md-toc
64
+
65
+ - name: Create Table of Contents
66
+ run: |
67
+ npm run-script document --if-present
68
+ rm gh-md-toc
69
+
70
+ - name: Commit files
71
+ run: |
72
+ git config --local user.email "github-actions[bot]@users.noreply.github.com"
73
+ git config --local user.name "github-actions[bot]"
74
+ git add * || true
75
+ git commit -a -m "Update TOC" || true
76
+
77
+ - name: Push changes
78
+ uses: ad-m/github-push-action@master
79
+ with:
80
+ github_token: ${{ secrets.GITHUB_TOKEN }}
81
+ branch: ${{ github.ref }}
81
82
 
82
83
  publish_prod_release:
84
+ permissions:
85
+ id-token: write
83
86
  needs: [get_tags, create_documentation]
84
87
  name: Publish Release Version
85
88
  if: ${{ needs.get_tags.outputs.BRANCH_NAME == 'main' }}
86
89
  uses: homebridge/.github/.github/workflows/npm-publish.yml@latest
87
90
  with:
88
- install_cmd: npm ci
91
+ install_cmd: npm ci
89
92
  secrets:
90
- npm_auth_token: ${{ secrets.npm_token }}
93
+ npm_auth_token: ${{ secrets.NPM_TOKEN }}
91
94
 
92
95
  publish_test_release:
96
+ permissions:
97
+ id-token: write
93
98
  needs: [get_tags, create_documentation]
94
99
  name: Publish Test Version - ${{ needs.get_tags.outputs.BRANCH_NAME }}
95
100
  if: ${{ needs.get_tags.outputs.BRANCH_NAME != 'main' }}
@@ -97,23 +102,24 @@ jobs:
97
102
  with:
98
103
  tag: ${{ needs.get_tags.outputs.TARGET_IMAGE_TAG }}
99
104
  dynamically_adjust_version: true
100
- npm_version_command: 'pre'
105
+ npm_version_command: pre
101
106
  pre_id: ${{ needs.get_tags.outputs.TARGET_IMAGE_TAG }}
107
+ install_cmd: npm ci
102
108
  secrets:
103
- npm_auth_token: ${{ secrets.npm_token }}
109
+ npm_auth_token: ${{ secrets.NPM_TOKEN }}
104
110
 
105
111
  publish_github_release:
106
112
  needs: [publish_prod_release]
107
113
  runs-on: ubuntu-latest
108
114
  steps:
109
- - uses: actions/checkout@v4
110
- - name: Create Release
111
- uses: softprops/action-gh-release@v1
112
- env:
113
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114
- with:
115
- tag_name: ${{ needs.publish_prod_release.outputs.NPM_VERSION }}
116
- name: Release ${{ needs.publish_prod_release.outputs.NPM_VERSION }}
117
- generate_release_notes: true
118
- draft: false
119
- prerelease: false
115
+ - uses: actions/checkout@v4
116
+ - name: Create Release
117
+ uses: softprops/action-gh-release@v1
118
+ env:
119
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
120
+ with:
121
+ tag_name: ${{ needs.publish_prod_release.outputs.NPM_VERSION }}
122
+ name: Release ${{ needs.publish_prod_release.outputs.NPM_VERSION }}
123
+ generate_release_notes: true
124
+ draft: false
125
+ prerelease: false
package/README.md CHANGED
@@ -34,6 +34,7 @@ The above Node-RED Flow, turns on my 'Outside Office' light when the powder room
34
34
  * [Jan 6, 2023 - Version 0.1.5](#jan-6-2023---version-015)
35
35
  * [Jan 11, 2023 - Version 0.1.7](#jan-11-2023---version-017)
36
36
  * [Jan 15, 2023 - Version 0.1.8](#jan-15-2023---version-018)
37
+ * [Dec 15, 2024 - Version 0.2.0](#dec-15-2024---version-020)
37
38
  * [Backlog / Roadmap](#backlog--roadmap)
38
39
  * [Dropped items](#dropped-items)
39
40
  * [Installation Steps](#installation-steps)
@@ -58,10 +59,6 @@ The above Node-RED Flow, turns on my 'Outside Office' light when the powder room
58
59
  * [Donations](#donations)
59
60
  * [Troubleshooting / DEBUG MODE](#troubleshooting--debug-mode)
60
61
  * [To start Node-RED in DEBUG mode, and output Homebridge-Automation debug logs start Node-RED like this.](#to-start-node-red-in-debug-mode-and-output-homebridge-automation-debug-logs-start-node-red-like-this)
61
-
62
- <!-- Created by https://github.com/ekalinin/github-markdown-toc -->
63
- <!-- Added by: runner, at: Sun Jul 7 00:03:36 UTC 2024 -->
64
-
65
62
  <!--te-->
66
63
 
67
64
  # Introduction
@@ -183,6 +180,12 @@ With a plugin, you can see if it supports Real Time events, by opening the Home
183
180
 
184
181
  - Workaround for #111
185
182
 
183
+ ### Dec 15, 2024 - Version 0.2.0
184
+
185
+ - Major code base refresh, and migration from hap-node-client to hap-client ( Potential fix for #120 )
186
+ - With the change in connectivity to homebridge, please validate all your nodes are connected after the update. And pay particular attention to `Camera` nodes, as for some devices the name has changed.
187
+ - Testing and Development was completed on Node-RED version: v4.0.2 and Node.js version: v20.18.1
188
+
186
189
  # Backlog / Roadmap
187
190
 
188
191
  * [x] - Update Node Information with Homebridge Accessory Details ( hapEndpoint, deviceType, description )
@@ -0,0 +1,34 @@
1
+ /** @type {import('eslint').FlatConfig[]} */
2
+ import pluginJs from "@eslint/js";
3
+ import pluginJest from "eslint-plugin-jest";
4
+ import globals from "globals";
5
+
6
+
7
+ export default [
8
+ {
9
+ files: ["**/*.js"],
10
+ languageOptions: {
11
+ sourceType: "commonjs", // This is necessary to parse imports/exports
12
+ globals: {
13
+ ...globals.browser,
14
+ ...globals.es2021,
15
+ ...globals.jest, // Add Jest globals
16
+ },
17
+ },
18
+ // Add any other specific rules here
19
+ },
20
+ pluginJs.configs.recommended,
21
+ {
22
+ plugins: {
23
+ jest: pluginJest,
24
+ },
25
+ rules: {
26
+ ...pluginJest.configs.recommended.rules,
27
+ "no-unused-vars": "warn", // Change no-unused-vars to a warning
28
+ },
29
+ },
30
+ {
31
+ // Exclude test, tools, and lib directories from linting
32
+ ignores: ["test/**/*", "tools/*js", "src/lib/*"], // Exclude these files from linting
33
+ }
34
+ ];
package/package.json CHANGED
@@ -1,16 +1,15 @@
1
1
  {
2
2
  "name": "node-red-contrib-homebridge-automation",
3
- "version": "0.1.12-beta.9",
3
+ "version": "0.2.1-beta.0",
4
4
  "description": "NodeRED Automation for HomeBridge",
5
5
  "main": "src/HAP-NodeRed.js",
6
6
  "scripts": {
7
- "api": "documentation build HAP-NodeRed.js -f md --config docs/documentation.yml > docs/API.md",
8
- "document": "./gh-md-toc --insert README.md; rm README.md.orig.* README.md.toc.*",
7
+ "document": "./gh-md-toc --insert --no-backup --hide-footer README.md",
9
8
  "watch": "nodemon",
10
- "coverage": "nyc npm t",
11
- "format": "prettier --write {.,test}/*.js *.html *.md",
12
- "lint": "eslint {.,test}/*.js",
13
- "test": "mocha \"test/**/*_spec.js\""
9
+ "lint": "eslint --max-warnings=10 .",
10
+ "lint:fix": "eslint --fix --max-warnings=0 .",
11
+ "test": "jest --detectOpenHandles",
12
+ "test-coverage": "jest --coverage"
14
13
  },
15
14
  "keywords": [
16
15
  "node-red",
@@ -26,28 +25,24 @@
26
25
  "url": "git+https://github.com/NorthernMan54/node-red-contrib-homebridge-automation.git"
27
26
  },
28
27
  "devDependencies": {
29
- "@types/node-red": "^0.20.7",
30
- "@types/jest": "^29.5.12",
31
- "documentation": "14.0.3",
32
- "eslint": "^8.57.0",
33
- "eslint-config-airbnb-typescript": "^18.0.0",
34
- "eslint-plugin-import": "^2.29.1",
35
- "eslint-plugin-import-newlines": "^1.4.0",
36
- "eslint-plugin-jest": "^28.6.0",
37
- "eslint-plugin-sort-exports": "^0.9.1",
38
- "mocha": "^10.6.0",
28
+ "@types/node-red": "^1.3.5",
29
+ "@types/jest": "^29.5.14",
30
+ "@eslint/js": "^9.16.0",
31
+ "eslint": "^8.57.1",
32
+ "eslint-plugin-format": "^0.1.2",
33
+ "eslint-plugin-jest": "^28.8.3",
34
+ "globals": "^15.13.0",
35
+ "jest": "^29.7.0",
39
36
  "node-red": "^4.0.2",
40
37
  "node-red-node-test-helper": "^0.3.4",
41
- "nodemon": "^3.1.4",
42
- "nyc": "^17.0.0",
43
- "prettier": "^3.3.2",
44
- "rimraf": "^5.0.7",
45
- "semver": "^7.6.2"
38
+ "nodemon": "^3.1.7",
39
+ "rimraf": "^6.0.1",
40
+ "semver": "^7.6.3"
46
41
  },
47
42
  "dependencies": {
48
43
  "better-queue": ">=3.8.12",
49
- "debug": "^4.3.5",
50
- "hap-node-client": ">=0.2.7"
44
+ "debug": "^4.3.7",
45
+ "@homebridge/hap-client": "^2.0.5"
51
46
  },
52
47
  "author": "NorthernMan54",
53
48
  "license": "ISC",
@@ -61,10 +56,24 @@
61
56
  ],
62
57
  "ext": "js,html",
63
58
  "ignore": [],
64
- "exec": "DEBUG=hapNodeRed ~/npm/bin/node-red",
59
+ "exec": "DEBUG=hapNodeRed* ~/npm/bin/node-red -v -u test/node-red",
65
60
  "signal": "SIGTERM",
66
61
  "env": {
67
62
  "NODE_OPTIONS": "--trace-warnings"
68
63
  }
64
+ },
65
+ "jest": {
66
+ "testEnvironment": "node",
67
+ "modulePathIgnorePatterns": [],
68
+ "coverageReporters": [
69
+ "lcov"
70
+ ],
71
+ "collectCoverageFrom": [
72
+ "src/**",
73
+ "!src/accessories/**",
74
+ "!src/lib/definitions/generate-definitions.ts",
75
+ "!src/lib/definitions/generator-configuration.ts",
76
+ "!src/test-utils"
77
+ ]
69
78
  }
70
79
  }