diff --git a/.github/workflows/deno.yml b/.github/workflows/deno.yml index accdc3c..cc89593 100644 --- a/.github/workflows/deno.yml +++ b/.github/workflows/deno.yml @@ -1,4 +1,4 @@ -name: Deno +name: Deno Format, Lint and Unit Tests on: push: @@ -9,13 +9,18 @@ on: jobs: test: runs-on: ubuntu-latest + strategy: + matrix: + # we test on both most recent stable version of deno (v1.x) as well as + # the version of deno used by Run on Slack (as noted in https://api.slack.com/slackcli/metadata.json) + deno-version: [v1.x, v1.45.4] steps: - name: Setup repo uses: actions/checkout@v4 - name: Setup Deno uses: denoland/setup-deno@v1 with: - deno-version: v1.x + deno-version: ${{ matrix.deno-version }} - name: Run formatter, linter and tests run: deno task test - name: Generate CodeCov-friendly coverage report diff --git a/.github/workflows/samples.yml b/.github/workflows/samples.yml index 5efbb46..a0c87ac 100644 --- a/.github/workflows/samples.yml +++ b/.github/workflows/samples.yml @@ -19,12 +19,15 @@ jobs: - slack-samples/deno-message-translator - slack-samples/deno-request-time-off - slack-samples/deno-simple-survey + # we test on both most recent stable version of deno (v1.x) as well as + # the version of deno used by Run on Slack (as noted in https://api.slack.com/slackcli/metadata.json) + deno-version: [v1.x, v1.45.4] steps: - - name: Setup Deno + - name: Setup Deno ${{ matrix.deno-version }} uses: denoland/setup-deno@v1 with: - deno-version: v1.x + deno-version: ${{ matrix.deno-version }} - name: Checkout the api uses: actions/checkout@v4 @@ -37,10 +40,10 @@ jobs: path: ./sample - name: Set imports.deno-slack-api/ to ../deno-slack-api/src/ in import_map.json - run: > + run: > deno run --allow-read --allow-write --allow-net - deno-slack-api/scripts/import_map/update.ts + deno-slack-api/scripts/src/import_map/update.ts --import-map "./sample/import_map.json" --parent-import-map "./deno-slack-api/deno.jsonc" --api "../deno-slack-api/src/" diff --git a/scripts/import_map/update.ts b/scripts/src/import_map/update.ts similarity index 100% rename from scripts/import_map/update.ts rename to scripts/src/import_map/update.ts diff --git a/scripts/import_map/update_test.ts b/scripts/src/import_map/update_test.ts similarity index 96% rename from scripts/import_map/update_test.ts rename to scripts/src/import_map/update_test.ts index cc200f2..d5cd199 100644 --- a/scripts/import_map/update_test.ts +++ b/scripts/src/import_map/update_test.ts @@ -1,5 +1,5 @@ import { isHttpError } from "@std/http/http-errors"; -import { mf } from "../../src/dev_deps.ts"; +import { mf } from "../../../src/dev_deps.ts"; import { assertEquals, assertRejects } from "@std/assert"; import { afterEach, beforeAll } from "@std/testing/bdd"; import { apiDepsIn } from "./update.ts"; diff --git a/src/typed-method-types/workflows/triggers/inputs.ts b/src/typed-method-types/workflows/triggers/inputs.ts index 0d57658..09f6e50 100644 --- a/src/typed-method-types/workflows/triggers/inputs.ts +++ b/src/typed-method-types/workflows/triggers/inputs.ts @@ -60,11 +60,9 @@ type InputSchema = Params extends type WorkflowInputsType = // This intentionally avoids Distributive Conditional Types, so be careful removing any of the following square brackets // See https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types for more details - [keyof Params["properties"]] extends [string] - // Since never extends string, must check for no properties + [keyof Params["properties"]] extends [string] // Since never extends string, must check for no properties ? [keyof Params["properties"]] extends [never] ? EmptyInputs - : Params["required"] extends Array ? [T] extends [never] - // If there are no required properties, inputs are optional + : Params["required"] extends Array ? [T] extends [never] // If there are no required properties, inputs are optional ? PopulatedInputs // If there are required params, inputs are required : Required> diff --git a/src/typed-method-types/workflows/triggers/tests/webhook_test.ts b/src/typed-method-types/workflows/triggers/tests/webhook_test.ts index e6f5157..ad3d69f 100644 --- a/src/typed-method-types/workflows/triggers/tests/webhook_test.ts +++ b/src/typed-method-types/workflows/triggers/tests/webhook_test.ts @@ -90,8 +90,6 @@ Deno.test("Mock call for webhook", async (t) => { ); } mf.reset(); - - mf.reset(); }, ); });