diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a44f75b2..606d8cd8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -65,12 +65,12 @@ Pull requests are the best way to propose changes to the codebase (we use [Githu 2. Install dependencies `yarn install` -3. See the `package.json` how to run the test. +3. Run `yarn run` to see the scripts available e.g. `yarn run all` to build, lint and test 4. Run the CLI locally ```bash - yarn run dev src/cli.ts + node lib/cli.js ``` ### Adding tests diff --git a/__tests__/cli.test.ts b/__tests__/cli.test.ts index faffca97..5e9cae68 100644 --- a/__tests__/cli.test.ts +++ b/__tests__/cli.test.ts @@ -25,7 +25,7 @@ describe("CLI tests", () => { test("Console output with TOC 3 and no banner.", async () => { const result = await cli( - `-a __tests__/fixtures/all_fields_action.yml -t 3 --no-banner`, + `-a ${path.join(fixtureDir, "all_fields_action.yml")} -t 3 --no-banner`, ); const expected = ( diff --git a/package.json b/package.json index 23b88450..1fb6c286 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,8 @@ "test": "yarn run test-default && yarn run test-cli", "test-default": "jest --testTimeout=10000 --testPathIgnorePatterns=__tests__/cli.test.ts --collect-coverage --coverage", "test-cli": "nyc jest --testTimeout=10000 --silent --testMatch=**/cli*test.ts && nyc report --reporter=lcov --reporter=html --report-dir=./coverage_nyc", + "test-action": "nyc jest --testTimeout=10000 --silent --testMatch=**/action-docs.test.ts --coverage=false", + "dev-action": "node lib/cli.js -a __tests__/fixtures/action.yml", "all": "yarn run build && yarn run format && yarn run lint && yarn test" }, "repository": { diff --git a/yarn.lock b/yarn.lock index 509cd7dd..3de40ac5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1503,13 +1503,14 @@ default-require-extensions@^3.0.0: strip-bom "^4.0.0" define-data-property@^1.0.1, define-data-property@^1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" - integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.3.tgz#281845e04737d709c2de99e278546189b65d3055" + integrity sha512-h3GBouC+RPtNX2N0hHVLo2ZwPYurq8mLmXpOLTsw71gr7lHt5VaI4vVkDUNOfiWmm48JEXe3VM7PmLX45AMmmg== dependencies: - es-define-property "^1.0.0" es-errors "^1.3.0" + get-intrinsic "^1.2.4" gopd "^1.0.1" + has-property-descriptors "^1.0.1" define-properties@^1.1.3, define-properties@^1.2.0, define-properties@^1.2.1: version "1.2.1" @@ -1591,52 +1592,50 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.22.1, es-abstract@^1.22.3, es-abstract@^1.22.4: - version "1.22.4" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.22.4.tgz#26eb2e7538c3271141f5754d31aabfdb215f27bf" - integrity sha512-vZYJlk2u6qHYxBOTjAeg7qUxHdNfih64Uu2J8QqWgXZ2cri0ZpJAkzDUK/q593+mvKwlxyaxr6F1Q+3LKoQRgg== +es-abstract@^1.22.1, es-abstract@^1.22.3: + version "1.22.3" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.22.3.tgz#48e79f5573198de6dee3589195727f4f74bc4f32" + integrity sha512-eiiY8HQeYfYH2Con2berK+To6GrK2RxbPawDkGq4UiCQQfZHb6wX9qQqkbpPqaxQFcl8d9QzZqo0tGE0VcrdwA== dependencies: - array-buffer-byte-length "^1.0.1" - arraybuffer.prototype.slice "^1.0.3" - available-typed-arrays "^1.0.6" - call-bind "^1.0.7" - es-define-property "^1.0.0" - es-errors "^1.3.0" - es-set-tostringtag "^2.0.2" + array-buffer-byte-length "^1.0.0" + arraybuffer.prototype.slice "^1.0.2" + available-typed-arrays "^1.0.5" + call-bind "^1.0.5" + es-set-tostringtag "^2.0.1" es-to-primitive "^1.2.1" function.prototype.name "^1.1.6" - get-intrinsic "^1.2.4" - get-symbol-description "^1.0.2" + get-intrinsic "^1.2.2" + get-symbol-description "^1.0.0" globalthis "^1.0.3" gopd "^1.0.1" - has-property-descriptors "^1.0.2" + has-property-descriptors "^1.0.0" has-proto "^1.0.1" has-symbols "^1.0.3" - hasown "^2.0.1" - internal-slot "^1.0.7" - is-array-buffer "^3.0.4" + hasown "^2.0.0" + internal-slot "^1.0.5" + is-array-buffer "^3.0.2" is-callable "^1.2.7" is-negative-zero "^2.0.2" is-regex "^1.1.4" is-shared-array-buffer "^1.0.2" is-string "^1.0.7" - is-typed-array "^1.1.13" + is-typed-array "^1.1.12" is-weakref "^1.0.2" object-inspect "^1.13.1" object-keys "^1.1.1" - object.assign "^4.1.5" - regexp.prototype.flags "^1.5.2" - safe-array-concat "^1.1.0" - safe-regex-test "^1.0.3" + object.assign "^4.1.4" + regexp.prototype.flags "^1.5.1" + safe-array-concat "^1.0.1" + safe-regex-test "^1.0.0" string.prototype.trim "^1.2.8" string.prototype.trimend "^1.0.7" string.prototype.trimstart "^1.0.7" - typed-array-buffer "^1.0.1" + typed-array-buffer "^1.0.0" typed-array-byte-length "^1.0.0" typed-array-byte-offset "^1.0.0" typed-array-length "^1.0.4" unbox-primitive "^1.0.2" - which-typed-array "^1.1.14" + which-typed-array "^1.1.13" es-array-method-boxes-properly@^1.0.0: version "1.0.0" @@ -1656,20 +1655,20 @@ es-errors@^1.0.0, es-errors@^1.2.1, es-errors@^1.3.0: integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== es-iterator-helpers@^1.0.15: - version "1.0.17" - resolved "https://registry.yarnpkg.com/es-iterator-helpers/-/es-iterator-helpers-1.0.17.tgz#123d1315780df15b34eb181022da43e734388bb8" - integrity sha512-lh7BsUqelv4KUbR5a/ZTaGGIMLCjPGPqJ6q+Oq24YP0RdyptX1uzm4vvaqzk7Zx3bpl/76YLTTDj9L7uYQ92oQ== + version "1.0.16" + resolved "https://registry.yarnpkg.com/es-iterator-helpers/-/es-iterator-helpers-1.0.16.tgz#495756d38dd5f9cc8e3091e913ee790d353e6f28" + integrity sha512-CREG2A9Vq7bpDRnldhFcMKuKArvkZtsH6Y0DHOHVg49qhf+LD8uEdUM3OkOAICv0EziGtDEnQtqY2/mfBILpFw== dependencies: asynciterator.prototype "^1.0.0" - call-bind "^1.0.7" + call-bind "^1.0.6" define-properties "^1.2.1" - es-abstract "^1.22.4" + es-abstract "^1.22.3" es-errors "^1.3.0" es-set-tostringtag "^2.0.2" function-bind "^1.1.2" get-intrinsic "^1.2.4" globalthis "^1.0.3" - has-property-descriptors "^1.0.2" + has-property-descriptors "^1.0.1" has-proto "^1.0.1" has-symbols "^1.0.3" internal-slot "^1.0.7"