skuba 4.3.1 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/jest/moduleNameMapper.test.ts +7 -8
  2. package/lib/api/jest/index.d.ts +4 -5
  3. package/lib/api/jest/index.js.map +1 -1
  4. package/lib/cli/configure/ensureTemplateCompletion.js +2 -2
  5. package/lib/cli/configure/ensureTemplateCompletion.js.map +1 -1
  6. package/lib/cli/configure/modules/tsconfig.js +3 -2
  7. package/lib/cli/configure/modules/tsconfig.js.map +1 -1
  8. package/lib/cli/configure/processing/package.d.ts +1 -1
  9. package/lib/cli/configure/processing/package.js +8 -10
  10. package/lib/cli/configure/processing/package.js.map +1 -1
  11. package/package.json +14 -12
  12. package/template/base/_.eslintignore +5 -2
  13. package/template/base/_.gitignore +3 -2
  14. package/template/base/_.prettierignore +5 -2
  15. package/template/express-rest-api/package.json +1 -1
  16. package/template/koa-rest-api/package.json +3 -3
  17. package/template/koa-rest-api/src/api/jobs/postJob.test.ts +7 -3
  18. package/template/koa-rest-api/src/framework/server.test.ts +18 -18
  19. package/template/koa-rest-api/src/framework/validation.test.ts +15 -6
  20. package/template/lambda-sqs-worker/package.json +1 -1
  21. package/template/lambda-sqs-worker/src/app.test.ts +7 -7
  22. package/template/lambda-sqs-worker/src/framework/handler.test.ts +3 -3
  23. package/template/lambda-sqs-worker/src/framework/validation.test.ts +17 -10
  24. package/template/lambda-sqs-worker/src/services/jobScorer.test.ts +2 -2
  25. package/template/lambda-sqs-worker/src/services/pipelineEventSender.test.ts +1 -1
  26. package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +220 -220
  27. package/template/oss-npm-package/_package.json +1 -1
  28. package/template/private-npm-package/_package.json +1 -1
@@ -25,7 +25,7 @@ describe('createHandler', () => {
25
25
 
26
26
  await expect(handler(input, ctx)).resolves.toBe(output);
27
27
 
28
- expect(logger.error).not.toBeCalled();
28
+ expect(logger.error).not.toHaveBeenCalled();
29
29
 
30
30
  expect(logger.info.mock.calls).toEqual([
31
31
  ['hello from handler'],
@@ -42,7 +42,7 @@ describe('createHandler', () => {
42
42
 
43
43
  expect(logger.error.mock.calls).toEqual([[{ err }, 'request']]);
44
44
 
45
- expect(logger.info).not.toBeCalled();
45
+ expect(logger.info).not.toHaveBeenCalled();
46
46
  });
47
47
 
48
48
  it('handles sync error', async () => {
@@ -56,6 +56,6 @@ describe('createHandler', () => {
56
56
 
57
57
  expect(logger.error.mock.calls).toEqual([[{ err }, 'request']]);
58
58
 
59
- expect(logger.info).not.toBeCalled();
59
+ expect(logger.info).not.toHaveBeenCalled();
60
60
  });
61
61
  });
@@ -28,21 +28,28 @@ describe('validateJson', () => {
28
28
  it('blocks mistyped prop', () => {
29
29
  const input = JSON.stringify({ ...idDescription, id: null });
30
30
 
31
- expect(() =>
32
- validateJson(input, filterIdDescription),
33
- ).toThrowErrorMatchingInlineSnapshot(
34
- `"Expected { id: string; description: string; }, but was incompatible"`,
35
- );
31
+ expect(() => validateJson(input, filterIdDescription))
32
+ .toThrowErrorMatchingInlineSnapshot(`
33
+ "Validation failed:
34
+ {
35
+ "id": "Expected string, but was null"
36
+ }.
37
+ Object should match { id: string; description: string; }"
38
+ `);
36
39
  });
37
40
 
38
41
  it('blocks missing prop', () => {
39
42
  const input = '{}';
40
43
 
41
- expect(() =>
42
- validateJson(input, filterIdDescription),
43
- ).toThrowErrorMatchingInlineSnapshot(
44
- `"Expected { id: string; description: string; }, but was incompatible"`,
45
- );
44
+ expect(() => validateJson(input, filterIdDescription))
45
+ .toThrowErrorMatchingInlineSnapshot(`
46
+ "Validation failed:
47
+ {
48
+ "id": "Expected string, but was missing",
49
+ "description": "Expected string, but was missing"
50
+ }.
51
+ Object should match { id: string; description: string; }"
52
+ `);
46
53
  });
47
54
 
48
55
  it('blocks invalid JSON', () => {
@@ -25,7 +25,7 @@ describe('scoreJobPublishedEvent', () => {
25
25
  eventType: 'JobScored',
26
26
  });
27
27
 
28
- expect(scoringService.request).toBeCalledTimes(1);
28
+ expect(scoringService.request).toHaveBeenCalledTimes(1);
29
29
  });
30
30
 
31
31
  it('bubbles up scoring service error', async () => {
@@ -39,6 +39,6 @@ describe('scoreJobPublishedEvent', () => {
39
39
  ),
40
40
  ).rejects.toThrow(err);
41
41
 
42
- expect(scoringService.request).toBeCalledTimes(1);
42
+ expect(scoringService.request).toHaveBeenCalledTimes(1);
43
43
  });
44
44
  });
@@ -15,7 +15,7 @@ describe('sendPipelineEvent', () => {
15
15
 
16
16
  await expect(sendPipelineEvent({})).resolves.toBe(messageId);
17
17
 
18
- expect(sns.publish).toBeCalledTimes(1);
18
+ expect(sns.publish).toHaveBeenCalledTimes(1);
19
19
  });
20
20
 
21
21
  it('bubbles up SNS error', () => {