Skip to content

Commit

Permalink
test: update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
jamacku committed Dec 12, 2023
1 parent 0d5f526 commit 43636ce
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"update-snapshots": "vitest run --update",
"all": "yarn run build && yarn run format && yarn run lint && yarn test"
},
"type": "module",
"packageManager": "[email protected]",
"repository": {
"type": "git",
Expand Down
3 changes: 1 addition & 2 deletions test/integration/about.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { expect, test, describe } from 'vitest';
import { object, unknown } from 'zod';

import TestingFarmAPI from '../../src/index';

Expand All @@ -22,7 +21,7 @@ describe('Test Testing Farm GET /about', () => {
const api = new TestingFarmAPI('https://api.dev.testing-farm.io/v0.0');

await expect(api.about()).rejects.toThrowErrorMatchingInlineSnapshot(
'"\\"Not Found\\""'
'"{\\"detail\\":\\"Not Found\\"}"'
);
});
});
6 changes: 3 additions & 3 deletions test/integration/new-request.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, test, describe } from 'vitest';
import { test, describe, expect } from 'vitest';

import TestingFarmAPI from '../../src/index';

Expand All @@ -11,15 +11,15 @@ describe('Test Testing Farm POST /requests', () => {
const api = new TestingFarmAPI('https://api.dev.testing-farm.io/v0.1');
});

test('bad API key', async () => {
test('bad request', async () => {
const api = new TestingFarmAPI('https://api.dev.testing-farm.io/v0.1');

const response = api.newRequest({
api_key: 'api_key',
test: {},
});
await expect(response).rejects.toThrowErrorMatchingInlineSnapshot(
"\"{\\\"errors\\\":{\\\"test\\\":\\\"Only one of test type 'fmf', 'tmt', 'script' or 'sti' can be specified in 'test' field.\\\"}}\""
'"{\\"message\\":\\"Test section is empty or test type is wrong.\\"}"'
);
});
});
6 changes: 3 additions & 3 deletions test/integration/request-details.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('Test Testing Farm GET /requests/{request_id}', () => {
);
expect(response).toMatchInlineSnapshot(`
{
"created": "2023-03-22 13:34:50.975382",
"created": "2023-03-22T13:34:50.975382",
"environments_requested": [
{
"arch": "x86_64",
Expand Down Expand Up @@ -57,7 +57,7 @@ describe('Test Testing Farm GET /requests/{request_id}', () => {
},
"settings": null,
"state": "complete",
"updated": "2023-03-22 13:34:50.975394",
"updated": "2023-03-22T13:34:50.975394",
"user_id": "d690baff-bfb0-4c30-a315-e71f9daa7de6",
}
`);
Expand All @@ -79,7 +79,7 @@ describe('Test Testing Farm GET /requests/{request_id}', () => {
await expect(
api.requestDetails('request_id')
).rejects.toThrowErrorMatchingInlineSnapshot(
'"{\\"code\\":404,\\"message\\":\\"No such entity\\"}"'
'"\\"Internal Server Error\\""'
);
});
});

0 comments on commit 43636ce

Please sign in to comment.