@friggframework/devtools 2.0.0--canary.666.81647c4.0 → 2.0.0--canary.668.8e53aa9.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/frigg-cli/README.md +1 -38
- package/frigg-cli/__tests__/unit/commands/build.test.js +0 -3
- package/frigg-cli/__tests__/unit/commands/deploy.test.js +0 -3
- package/frigg-cli/build-command/index.js +0 -6
- package/frigg-cli/deploy-command/index.js +0 -6
- package/frigg-cli/index.js +1 -13
- package/frigg-cli/init-command/backend-first-handler.js +46 -25
- package/frigg-cli/start-command/index.js +0 -4
- package/frigg-cli/start-command/start-command.test.js +0 -3
- package/infrastructure/create-frigg-infrastructure.js +1 -4
- package/infrastructure/docs/POSTGRES-CONFIGURATION.md +98 -60
- package/package.json +7 -7
- package/frigg-cli/__tests__/unit/commands/validate-wiring.test.js +0 -92
- package/frigg-cli/validate-command/__tests__/init-validation.test.js +0 -63
- package/frigg-cli/validate-command/__tests__/integrations-checks.test.js +0 -133
- package/frigg-cli/validate-command/__tests__/validate-app-definition.test.js +0 -326
- package/frigg-cli/validate-command/__tests__/validate-command.test.js +0 -241
- package/frigg-cli/validate-command/checks/config.js +0 -468
- package/frigg-cli/validate-command/checks/integrations.js +0 -274
- package/frigg-cli/validate-command/format-report.js +0 -58
- package/frigg-cli/validate-command/index.js +0 -107
- package/frigg-cli/validate-command/load-app-definition.js +0 -93
- package/frigg-cli/validate-command/schema-issues.js +0 -154
- package/frigg-cli/validate-command/validate-app-definition.js +0 -60
- package/infrastructure/app-definition-schema-contract.test.js +0 -607
- package/infrastructure/create-frigg-infrastructure.test.js +0 -51
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const os = require('os');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
|
|
5
|
-
jest.mock('@friggframework/core', () => ({
|
|
6
|
-
findNearestBackendPackageJson: jest.fn(),
|
|
7
|
-
}));
|
|
8
|
-
jest.mock('./infrastructure-composer', () => ({
|
|
9
|
-
composeServerlessDefinition: jest.fn(async () => ({ service: 'composed' })),
|
|
10
|
-
}));
|
|
11
|
-
|
|
12
|
-
const { findNearestBackendPackageJson } = require('@friggframework/core');
|
|
13
|
-
const { composeServerlessDefinition } = require('./infrastructure-composer');
|
|
14
|
-
const { createFriggInfrastructure } = require('./create-frigg-infrastructure');
|
|
15
|
-
|
|
16
|
-
describe('createFriggInfrastructure', () => {
|
|
17
|
-
let dir;
|
|
18
|
-
|
|
19
|
-
beforeEach(() => {
|
|
20
|
-
dir = fs.mkdtempSync(path.join(os.tmpdir(), 'frigg-infra-'));
|
|
21
|
-
fs.writeFileSync(path.join(dir, 'package.json'), '{"name":"backend"}');
|
|
22
|
-
fs.writeFileSync(
|
|
23
|
-
path.join(dir, 'index.js'),
|
|
24
|
-
`class Acme { static Definition = { name: 'acme' }; }
|
|
25
|
-
module.exports = { Definition: { name: 'app', integrations: [Acme], user: { usePassword: true } } };`
|
|
26
|
-
);
|
|
27
|
-
findNearestBackendPackageJson.mockReturnValue(
|
|
28
|
-
path.join(dir, 'package.json')
|
|
29
|
-
);
|
|
30
|
-
jest.spyOn(console, 'log').mockImplementation(() => {});
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
afterEach(() => {
|
|
34
|
-
fs.rmSync(dir, { recursive: true, force: true });
|
|
35
|
-
jest.restoreAllMocks();
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('composes the definition with the schema defaults applied (ADR-051)', async () => {
|
|
39
|
-
await createFriggInfrastructure();
|
|
40
|
-
|
|
41
|
-
const [definition] = composeServerlessDefinition.mock.calls[0];
|
|
42
|
-
expect(definition.user).toEqual(
|
|
43
|
-
expect.objectContaining({
|
|
44
|
-
usePassword: true,
|
|
45
|
-
individualUserRequired: true,
|
|
46
|
-
})
|
|
47
|
-
);
|
|
48
|
-
expect(definition.integrations[0].Definition.name).toBe('acme');
|
|
49
|
-
expect(typeof definition.integrations[0]).toBe('function');
|
|
50
|
-
});
|
|
51
|
-
});
|