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.
- package/jest/moduleNameMapper.test.ts +7 -8
- package/lib/api/jest/index.d.ts +4 -5
- package/lib/api/jest/index.js.map +1 -1
- package/lib/cli/configure/ensureTemplateCompletion.js +2 -2
- package/lib/cli/configure/ensureTemplateCompletion.js.map +1 -1
- package/lib/cli/configure/modules/tsconfig.js +3 -2
- package/lib/cli/configure/modules/tsconfig.js.map +1 -1
- package/lib/cli/configure/processing/package.d.ts +1 -1
- package/lib/cli/configure/processing/package.js +8 -10
- package/lib/cli/configure/processing/package.js.map +1 -1
- package/package.json +14 -12
- package/template/base/_.eslintignore +5 -2
- package/template/base/_.gitignore +3 -2
- package/template/base/_.prettierignore +5 -2
- package/template/express-rest-api/package.json +1 -1
- package/template/koa-rest-api/package.json +3 -3
- package/template/koa-rest-api/src/api/jobs/postJob.test.ts +7 -3
- package/template/koa-rest-api/src/framework/server.test.ts +18 -18
- package/template/koa-rest-api/src/framework/validation.test.ts +15 -6
- package/template/lambda-sqs-worker/package.json +1 -1
- package/template/lambda-sqs-worker/src/app.test.ts +7 -7
- package/template/lambda-sqs-worker/src/framework/handler.test.ts +3 -3
- package/template/lambda-sqs-worker/src/framework/validation.test.ts +17 -10
- package/template/lambda-sqs-worker/src/services/jobScorer.test.ts +2 -2
- package/template/lambda-sqs-worker/src/services/pipelineEventSender.test.ts +1 -1
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +220 -220
- package/template/oss-npm-package/_package.json +1 -1
- 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.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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).
|
|
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).
|
|
42
|
+
expect(scoringService.request).toHaveBeenCalledTimes(1);
|
|
43
43
|
});
|
|
44
44
|
});
|