@applicaster/zapplicaster-cli 16.0.0-rc.56 → 16.0.0-rc.57

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapplicaster-cli",
3
- "version": "16.0.0-rc.56",
3
+ "version": "16.0.0-rc.57",
4
4
  "description": "CLI Tool for the zapp app and Quick Brick project",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
@@ -28,10 +28,10 @@
28
28
  },
29
29
  "homepage": "https://github.com/applicaster/quickbrick#readme",
30
30
  "dependencies": {
31
- "@applicaster/zapp-react-dom-cli-template": "16.0.0-rc.56",
32
- "@applicaster/zapp-react-native-android-tv-cli-template": "16.0.0-rc.56",
33
- "@applicaster/zapp-react-native-cli-template": "16.0.0-rc.56",
34
- "@applicaster/zapp-react-native-tvos-cli-template": "16.0.0-rc.56",
31
+ "@applicaster/zapp-react-dom-cli-template": "16.0.0-rc.57",
32
+ "@applicaster/zapp-react-native-android-tv-cli-template": "16.0.0-rc.57",
33
+ "@applicaster/zapp-react-native-cli-template": "16.0.0-rc.57",
34
+ "@applicaster/zapp-react-native-tvos-cli-template": "16.0.0-rc.57",
35
35
  "axios": "^0.28.0",
36
36
  "camelize": "^1.0.0",
37
37
  "chalk": "^2.3.2",
@@ -0,0 +1,58 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`reloadConfig runs the reload config task 1`] = `
4
+ [
5
+ [
6
+ "reload configuration",
7
+ "We're reloading the configuration for your app",
8
+ ],
9
+ ]
10
+ `;
11
+
12
+ exports[`reloadConfig runs the reload config task 2`] = `[]`;
13
+
14
+ exports[`reloadConfig runs the reload config task 3`] = `[]`;
15
+
16
+ exports[`reloadConfig runs the reload config task 4`] = `[]`;
17
+
18
+ exports[`reloadConfig runs the reload config task 5`] = `
19
+ [
20
+ [
21
+ "checking prerequisites...",
22
+ ],
23
+ [
24
+ "Gathering configuration",
25
+ ],
26
+ [
27
+ "Creating workspace",
28
+ ],
29
+ [
30
+ "Creating runtime URLs configuration file",
31
+ ],
32
+ [
33
+ "Retrieving configuration files",
34
+ ],
35
+ ]
36
+ `;
37
+
38
+ exports[`reloadConfig runs the reload config task 6`] = `
39
+ [
40
+ [
41
+ "All good - moving on",
42
+ ],
43
+ [
44
+ "configuration retrieved",
45
+ ],
46
+ [
47
+ "Workspace created !",
48
+ ],
49
+ [
50
+ "Runtime configuration URLs file created",
51
+ ],
52
+ [
53
+ "Configuration files retrieved !",
54
+ ],
55
+ ]
56
+ `;
57
+
58
+ exports[`reloadConfig runs the reload config task 7`] = `[]`;
@@ -0,0 +1,86 @@
1
+ const { reloadConfig } = require("../index");
2
+
3
+ const appVersionId = "e7a17c6f-4113-41ac-9450-6281d22153a1";
4
+
5
+ const options = {
6
+ appVersionId,
7
+ openSdk: true,
8
+ config: "some_file",
9
+ };
10
+
11
+ jest.mock("../../../logger", () => ({
12
+ welcome: jest.fn(),
13
+ log: jest.fn(),
14
+ error: jest.fn(),
15
+ warn: jest.fn(),
16
+ startStep: jest.fn(),
17
+ endStep: jest.fn(),
18
+ success: jest.fn(),
19
+ }));
20
+
21
+ jest.mock("../../prepareWorkspace/prerequisitesChecker.js", () => ({
22
+ prerequisitesChecker: jest.fn(() => true),
23
+ }));
24
+
25
+ const mockConfig = { appVersionId, buildParams: {} };
26
+
27
+ jest.mock("../../prepareWorkspace/configurator.js", () => ({
28
+ configurator: jest.fn(() => mockConfig),
29
+ }));
30
+
31
+ jest.mock("../../prepareWorkspace/workspaceCreator.js", () => ({
32
+ workspaceCreator: jest.fn(),
33
+ }));
34
+
35
+ jest.mock("../../prepareWorkspace/configFilesRetriever.js", () => ({
36
+ configFilesRetriever: jest.fn(),
37
+ }));
38
+
39
+ jest.mock("../../prepareWorkspace/runtimeConfigurationUrlsCreator.js", () => ({
40
+ runtimeConfigurationUrlsCreator: jest.fn(),
41
+ }));
42
+
43
+ const {
44
+ prerequisitesChecker,
45
+ } = require("../../prepareWorkspace/prerequisitesChecker");
46
+
47
+ const { configurator } = require("../../prepareWorkspace/configurator");
48
+ const { workspaceCreator } = require("../../prepareWorkspace/workspaceCreator");
49
+
50
+ const {
51
+ configFilesRetriever,
52
+ } = require("../../prepareWorkspace/configFilesRetriever");
53
+
54
+ const {
55
+ runtimeConfigurationUrlsCreator,
56
+ } = require("../../prepareWorkspace/runtimeConfigurationUrlsCreator");
57
+
58
+ const logger = require("../../../logger");
59
+
60
+ describe("reloadConfig", () => {
61
+ it("runs the reload config task", async () => {
62
+ await reloadConfig(appVersionId, options);
63
+
64
+ expect(logger.welcome.mock.calls).toMatchSnapshot();
65
+ expect(logger.log.mock.calls).toMatchSnapshot();
66
+ expect(logger.error.mock.calls).toMatchSnapshot();
67
+ expect(logger.warn.mock.calls).toMatchSnapshot();
68
+ expect(logger.startStep.mock.calls).toMatchSnapshot();
69
+ expect(logger.endStep.mock.calls).toMatchSnapshot();
70
+ expect(logger.success.mock.calls).toMatchSnapshot();
71
+
72
+ expect(prerequisitesChecker).toHaveBeenCalledWith({
73
+ cliArgs: [appVersionId],
74
+ cliOptions: options,
75
+ });
76
+
77
+ expect(configurator).toHaveBeenCalledWith({
78
+ cliArgs: [appVersionId],
79
+ cliOptions: options,
80
+ });
81
+
82
+ expect(workspaceCreator).toHaveBeenCalledWith(mockConfig);
83
+ expect(runtimeConfigurationUrlsCreator).toHaveBeenCalledWith(mockConfig);
84
+ expect(configFilesRetriever).toHaveBeenCalledWith(mockConfig);
85
+ });
86
+ });
@@ -27,18 +27,18 @@ const reloadConfigTask = {
27
27
  error: "Could not create workspace",
28
28
  completion: "Workspace created !",
29
29
  },
30
- {
31
- start: "Retrieving configuration files",
32
- run: configFilesRetriever,
33
- error: "Could not retrieve configuration files",
34
- completion: "Configuration files retrieved !",
35
- },
36
30
  {
37
31
  start: "Creating runtime URLs configuration file",
38
32
  run: runtimeConfigurationUrlsCreator,
39
33
  error: "Could not create runtime_configuration_urls.json",
40
34
  completion: "Runtime configuration URLs file created",
41
35
  },
36
+ {
37
+ start: "Retrieving configuration files",
38
+ run: configFilesRetriever,
39
+ error: "Could not retrieve configuration files",
40
+ completion: "Configuration files retrieved !",
41
+ },
42
42
  ],
43
43
  };
44
44