From 1d85422199f3513f5645beff261f655812f6b31f Mon Sep 17 00:00:00 2001 From: Laura Armitage Date: Tue, 13 Feb 2024 15:55:28 +0000 Subject: [PATCH] GH-240 update CONTRIBUTING where command does not work and add additional helper scripts --- CONTRIBUTING.md | 4 ++-- __tests__/cli.test.ts | 2 +- package.json | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) 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": {