diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 385f5c6..0907431 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,8 @@ jobs: fail-fast: false matrix: version: [22.x, 20.x, 18.x] - os: [sfdc-hk-ubuntu-latest, sfdc-hk-windows-latest] + os: + [sfdc-hk-ubuntu-latest, sfdc-hk-macos-latest, sfdc-hk-windows-latest] name: Node ${{ matrix.version }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} steps: diff --git a/mappings/bulk-api-query-get-7508Z00000lTqQCQA0-result.json b/mappings/bulk-api-query-get-7508Z00000lTqQCQA0-result.json index 0079eb6..4157ce0 100644 --- a/mappings/bulk-api-query-get-7508Z00000lTqQCQA0-result.json +++ b/mappings/bulk-api-query-get-7508Z00000lTqQCQA0-result.json @@ -1,4 +1,5 @@ { + "priority": 2, "request": { "method": "GET", "urlPath": "/services/data/v56.0/jobs/query/7508Z00000lTqQCQA0/results" diff --git a/mappings/bulk-api-query-get-more-results.json b/mappings/bulk-api-query-get-more-results.json index 94c81f6..64f2651 100644 --- a/mappings/bulk-api-query-get-more-results.json +++ b/mappings/bulk-api-query-get-more-results.json @@ -1,4 +1,5 @@ { + "priority": 1, "request": { "method": "GET", "urlPath": "/services/data/v56.0/jobs/query/7508Z00000lTqQCQA0/results", diff --git a/mappings/bulk-api-query-get-results-server-error.json b/mappings/bulk-api-query-get-results-server-error.json index 4b3699a..5cc2772 100644 --- a/mappings/bulk-api-query-get-results-server-error.json +++ b/mappings/bulk-api-query-get-results-server-error.json @@ -1,4 +1,5 @@ { + "priority": 1, "request": { "method": "GET", "urlPath": "/services/data/v56.0/jobs/query/7508Z00000lTqQCQA0/results", diff --git a/mappings/data-api-create-invalid-token-session-error.json b/mappings/data-api-create-invalid-token-session-error.json index 6ab1f59..77b0196 100644 --- a/mappings/data-api-create-invalid-token-session-error.json +++ b/mappings/data-api-create-invalid-token-session-error.json @@ -4,13 +4,13 @@ "urlPath": "/services/data/v51.0/sobjects/Account" }, "response": { - "status": 400, + "status": 401, "headers": { "Content-Type": "application/json;charset=UTF-8" }, "jsonBody": { - "errorCode": "NOT_FOUND", - "message": "blah" + "errorCode": "INVALID_SESSION_ID", + "message": "Session expired or invalid" } } } diff --git a/package.json b/package.json index c30a2a0..6171b90 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "build": "tsc -b", "lint": "eslint . --ext .ts --max-warnings 0 --report-unused-disable-directives --format codeframe", "lint:fix": "npm run lint -- --fix", - "wiremock": "wiremock --port 8080 --bind-address 127.0.0.1 --disable-banner", + "wiremock": "JAVA_OPTS='-Xmx1024m -Xms512m' wiremock --port 8080 --bind-address 127.0.0.1 --disable-banner", "mocha": "mocha", "test": "cross-env NODE_ENV=test TS_NODE_PROJECT=tsconfig.test.json concurrently -k -s first \"wiremock\" \"mocha\"", "test:coverage": "nyc --reporter=lcov --reporter=text-summary yarn test", diff --git a/test/sdk/bulk-api.test.ts b/test/sdk/bulk-api.test.ts index 061ab31..0c69ad5 100644 --- a/test/sdk/bulk-api.test.ts +++ b/test/sdk/bulk-api.test.ts @@ -72,6 +72,7 @@ describe("bulkApi", function () { describe("ingest", () => { beforeEach(async () => { await resetScenarios(); + await clearScenarioMemory(); }); it("ingesting a small dataset", async () => { @@ -705,8 +706,7 @@ describe("bulkApi", function () { ]); }); - // TODO: This is getting skipped because it only fails in ubuntu, it falls back incorrectly. - it.skip("should be possible to get more results for a query job and specify the maximum records to return", async () => { + it("should be possible to get more results for a query job and specify the maximum records to return", async () => { const currentResults: QueryJobResults = { locator: "MjAwMOMG", done: false, @@ -1075,6 +1075,16 @@ async function setScenarioState(name: string, state: string): Promise { } } +async function clearScenarioMemory() { + const res = await fetch(`${WIREMOCK_URL}/__admin/requests`, { + method: "DELETE", + }); + + if (!res.ok) { + throw new Error(`could not clear wiremock scenario memory`); + } +} + async function resetScenarios() { const res = await fetch(`${WIREMOCK_URL}/__admin/scenarios/reset`, { method: "POST", diff --git a/test/sdk/data-api.ts b/test/sdk/data-api.ts index 53800df..bb8835a 100644 --- a/test/sdk/data-api.ts +++ b/test/sdk/data-api.ts @@ -86,8 +86,7 @@ describe("DataApi Class", async () => { }); describe("invalid token", async () => { - // TODO: skipping because this doesn't appear possible, how is the promise be rejected but the req return a body? - it.skip("throws an invalid session error", async () => { + it("throws an invalid session error", async () => { try { await dataApiInvalidToken.create({ type: "Account",