@24i/smartapps-bigscreen-rnv-build-engine 0.8.7-alpha.1414 → 0.8.7-alpha.1416
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/README.md +1 -2
- package/dist/src/__tests__/sdks/sdk-utils/sdk-installer/sdkInstaller.spec.js +88 -0
- package/dist/src/__tests__/sdks/sdk-utils/sdk-installer/services/clean.spec.js +46 -0
- package/dist/src/__tests__/sdks/sdk-utils/sdk-installer/services/download.spec.js +121 -0
- package/dist/src/__tests__/sdks/sdk-utils/sdk-installer/services/install.spec.js +53 -0
- package/dist/src/__tests__/sdks/sdk-utils/sdk-installer/services/unzip.spec.js +47 -0
- package/dist/src/resolvers/resolveBaseUrl.js +1 -1
- package/dist/src/resolvers/resolveBuildFileName.js +2 -2
- package/dist/src/resolvers/resolveBuildVersion.js +2 -2
- package/dist/src/resolvers/resolveBuildVersionOffset.js +2 -2
- package/dist/src/resolvers/resolveDeployLocations.js +5 -5
- package/dist/src/resolvers/resolveGenericRnvConfig.js +2 -2
- package/dist/src/resolvers/resolveHbbtvDeployUrl.js +2 -2
- package/dist/src/resolvers/resolveUsedFlavours.js +1 -1
- package/dist/src/scripts/buildAllWithScheme.js +3 -3
- package/dist/src/scripts/generateDeployUrls/index.js +4 -4
- package/dist/src/scripts/generateDeployUrls/makeTableDataByScheme.js +3 -3
- package/dist/src/scripts/gitReleaser/afterVersionBump.js +6 -6
- package/dist/src/scripts/gitReleaser/beforeVersionBump.js +6 -6
- package/dist/src/scripts/gitReleaser/checkReleaseNotes.js +1 -1
- package/dist/src/scripts/gitReleaser/pushRelease.js +7 -7
- package/dist/src/scripts/gitReleaser/pushReleaseCandidate.js +1 -1
- package/dist/src/scripts/gitReleaser/pushReleaseNotes.js +7 -7
- package/dist/src/scripts/release/deleteSourceMaps.js +1 -1
- package/dist/src/scripts/release/deployToAppCenter.js +6 -6
- package/dist/src/scripts/release/githubRelease.js +16 -16
- package/dist/src/scripts/release/notifySlack/makePayload.js +1 -1
- package/dist/src/scripts/release/notifySlack/notifySlack.js +1 -1
- package/dist/src/scripts/release/sentryRelease.js +3 -3
- package/dist/src/scripts/release/urlsMarkdown.js +1 -1
- package/dist/src/scripts/releaseAllWithScheme.js +11 -11
- package/dist/src/scripts/utils/cmdUtils.js +1 -1
- package/dist/src/scripts/utils/fsUtils.js +1 -1
- package/dist/src/scripts/utils/gitUtils.js +17 -17
- package/dist/src/sdks/sdk-tizen/index.js +10 -10
- package/dist/src/sdks/sdk-utils/index.js +14 -0
- package/dist/src/sdks/sdk-utils/installSdk.js +10 -0
- package/dist/src/sdks/{sdkUtils.js → sdk-utils/registerSdkPath.js} +1 -8
- package/dist/src/sdks/sdk-utils/sdk-installer/index.js +5 -0
- package/dist/src/sdks/sdk-utils/sdk-installer/sdkInstaller.js +38 -0
- package/dist/src/sdks/sdk-utils/sdk-installer/services/clean.js +11 -0
- package/dist/src/sdks/sdk-utils/sdk-installer/services/download.js +74 -0
- package/dist/src/sdks/sdk-utils/sdk-installer/services/index.js +11 -0
- package/dist/src/sdks/sdk-utils/sdk-installer/services/install.js +23 -0
- package/dist/src/sdks/sdk-utils/sdk-installer/services/unzip.js +12 -0
- package/dist/src/sdks/sdk-webos/index.js +5 -5
- package/dist/src/tasks/deploy/aswS3/aws.js +2 -2
- package/dist/src/tasks/deploy/aswS3/deployS3.js +2 -2
- package/dist/src/tasks/deploy/hbbtv/deployHbbtv.js +7 -7
- package/dist/src/tasks/task.rnv.build.js +8 -8
- package/dist/src/tasks/task.rnv.configure.js +1 -1
- package/dist/src/tasks/task.rnv.configureSoft.js +2 -2
- package/dist/src/tasks/task.rnv.deploy.js +3 -3
- package/dist/src/tasks/task.rnv.hooks.run.js +1 -1
- package/dist/src/tasks/task.rnv.project.configure.js +2 -2
- package/dist/src/utils/forEachSupportedPlatformFlavour.js +1 -1
- package/dist/src/utils/replaceRelevantStringsInConfig/replaceRelevantStringsInConfig.js +1 -1
- package/dist/src/utils/replaceRelevantStringsInConfig/replaceTemplateString.js +1 -1
- package/dist/src/utils/zipBuildsByPlatforms.js +9 -9
- package/dist/templates/platforms/entone/webpack.config.dev.js +1 -1
- package/dist/templates/platforms/entone/webpack.config.prod.js +1 -1
- package/dist/templates/platforms/hbbtv/webpack.config.dev.js +1 -1
- package/dist/templates/platforms/hbbtv/webpack.config.prod.js +1 -1
- package/dist/templates/platforms/saphi/webpack.config.dev.js +1 -1
- package/dist/templates/platforms/saphi/webpack.config.prod.js +1 -1
- package/dist/templates/platforms/tizen/webpack.config.dev.js +1 -1
- package/dist/templates/platforms/tizen/webpack.config.prod.js +1 -1
- package/dist/templates/platforms/webos/webpack.config.dev.js +1 -1
- package/dist/templates/platforms/webos/webpack.config.prod.js +1 -1
- package/dist/templates/platforms/webtv/webpack.config.dev.js +1 -1
- package/dist/templates/platforms/webtv/webpack.config.prod.js +1 -1
- package/jest.config.js +3 -0
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -126,7 +126,7 @@ An example:
|
|
|
126
126
|
---
|
|
127
127
|
## Package content
|
|
128
128
|
|
|
129
|
-
### npm
|
|
129
|
+
### npm dependencies
|
|
130
130
|
All npm dependencies are listed in [package.json](package.json) file.
|
|
131
131
|
|
|
132
132
|
However, not all dependencies are directly bundled into a final npm package,
|
|
@@ -148,7 +148,6 @@ Firstly, the package contains main ReNative npm packages, namely:
|
|
|
148
148
|
Following dependencies are used in source code for custom build engine for ReNative:
|
|
149
149
|
|
|
150
150
|
- `@24i/smartapps-bigscreen-icon` *(generating SVG icons)*
|
|
151
|
-
- `@24i/smartapps-bigscreen-sdk-installer` *(installing SDKs for Tizen or webOS)*
|
|
152
151
|
- `glob` *(searching output builds)*
|
|
153
152
|
- `node-ssh` *(connection to HbbTV server)*
|
|
154
153
|
- `svgo` *(generating SVG icons)*
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const sdk_installer_1 = require("../../../../sdks/sdk-utils/sdk-installer");
|
|
4
|
+
const services_1 = require("../../../../sdks/sdk-utils/sdk-installer/services");
|
|
5
|
+
jest.mock('../../../../sdks/sdk-utils/sdk-installer/services/download');
|
|
6
|
+
jest.mock('../../../../sdks/sdk-utils/sdk-installer/services/unzip');
|
|
7
|
+
jest.mock('../../../../sdks/sdk-utils/sdk-installer/services/install');
|
|
8
|
+
jest.mock('../../../../sdks/sdk-utils/sdk-installer/services/clean');
|
|
9
|
+
describe('SDK Installer', () => {
|
|
10
|
+
const URL_TO_DOWNLOAD_FILE_FROM = 'https://s3.amazonaws.com/file.zip';
|
|
11
|
+
const runSdkInstallerWithDefinedZipPath = async () => {
|
|
12
|
+
await sdk_installer_1.sdkInstaller({ zipPath: URL_TO_DOWNLOAD_FILE_FROM });
|
|
13
|
+
};
|
|
14
|
+
afterEach(() => {
|
|
15
|
+
jest.clearAllMocks();
|
|
16
|
+
});
|
|
17
|
+
describe('throwing the errors', () => {
|
|
18
|
+
it('throws an error when zipPath is not a URL', async () => {
|
|
19
|
+
await expect(async () => {
|
|
20
|
+
await sdk_installer_1.sdkInstaller({ zipPath: '/local/path.zip' });
|
|
21
|
+
}).rejects.toBeInstanceOf(Error);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
describe('printing log messages', () => {
|
|
25
|
+
it('does not print log messages by default', async () => {
|
|
26
|
+
const writeSpy = jest.spyOn(process.stdout, 'write');
|
|
27
|
+
await runSdkInstallerWithDefinedZipPath();
|
|
28
|
+
expect(writeSpy).not.toHaveBeenCalled();
|
|
29
|
+
});
|
|
30
|
+
it('shows log messages when enabled', async () => {
|
|
31
|
+
const writeSpy = jest.spyOn(process.stdout, 'write');
|
|
32
|
+
writeSpy.mockImplementation(() => true);
|
|
33
|
+
await sdk_installer_1.sdkInstaller({ zipPath: URL_TO_DOWNLOAD_FILE_FROM, enableLogs: true });
|
|
34
|
+
expect(writeSpy).toHaveBeenCalled();
|
|
35
|
+
});
|
|
36
|
+
it('does not print log messages when it is not enabled', async () => {
|
|
37
|
+
const writeSpy = jest.spyOn(process.stdout, 'write');
|
|
38
|
+
await sdk_installer_1.sdkInstaller({ zipPath: URL_TO_DOWNLOAD_FILE_FROM, enableLogs: false });
|
|
39
|
+
expect(writeSpy).not.toHaveBeenCalled();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
describe('passing values to services when correct URL to ZIP file is provided', () => {
|
|
43
|
+
it('calls downloader with requested url to download file from', async () => {
|
|
44
|
+
await runSdkInstallerWithDefinedZipPath();
|
|
45
|
+
const filePathToSave = `${process.cwd()}/file.zip`;
|
|
46
|
+
expect(services_1.download).toHaveBeenCalledWith(URL_TO_DOWNLOAD_FILE_FROM, filePathToSave);
|
|
47
|
+
});
|
|
48
|
+
it('calls unzipper with requested file path to unzip', async () => {
|
|
49
|
+
await runSdkInstallerWithDefinedZipPath();
|
|
50
|
+
expect(services_1.unzip).toHaveBeenCalledWith(`${process.cwd()}/file.zip`);
|
|
51
|
+
});
|
|
52
|
+
it('calls installer with path to unzipped directory only', async () => {
|
|
53
|
+
await runSdkInstallerWithDefinedZipPath();
|
|
54
|
+
expect(services_1.install).toHaveBeenCalledWith(`${process.cwd()}/file`, undefined);
|
|
55
|
+
});
|
|
56
|
+
it('calls installer with path to unzipped directory and path to install to', async () => {
|
|
57
|
+
await sdk_installer_1.sdkInstaller({
|
|
58
|
+
zipPath: URL_TO_DOWNLOAD_FILE_FROM,
|
|
59
|
+
installPath: '/install/path',
|
|
60
|
+
});
|
|
61
|
+
expect(services_1.install).toHaveBeenCalledWith(`${process.cwd()}/file`, '/install/path');
|
|
62
|
+
});
|
|
63
|
+
it('calls cleaner with array including downloaded zip and unzipped dir paths', async () => {
|
|
64
|
+
await runSdkInstallerWithDefinedZipPath();
|
|
65
|
+
expect(services_1.clean).toHaveBeenCalledWith([
|
|
66
|
+
`${process.cwd()}/file.zip`,
|
|
67
|
+
`${process.cwd()}/file`,
|
|
68
|
+
]);
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
describe('cleaning when error occurs', () => {
|
|
72
|
+
it('calls cleaner when downloader throws an error', async () => {
|
|
73
|
+
services_1.download.mockImplementationOnce(async () => { throw new Error(); });
|
|
74
|
+
await expect(runSdkInstallerWithDefinedZipPath).rejects.toBeInstanceOf(Error);
|
|
75
|
+
expect(services_1.clean).toBeCalledTimes(1);
|
|
76
|
+
});
|
|
77
|
+
it('calls cleaner when unzipper throws an error', async () => {
|
|
78
|
+
services_1.unzip.mockImplementationOnce(() => { throw new Error(); });
|
|
79
|
+
await expect(runSdkInstallerWithDefinedZipPath).rejects.toBeInstanceOf(Error);
|
|
80
|
+
expect(services_1.clean).toBeCalledTimes(1);
|
|
81
|
+
});
|
|
82
|
+
it('calls cleaner when installer throws an error', async () => {
|
|
83
|
+
services_1.install.mockImplementationOnce(() => { throw new Error(); });
|
|
84
|
+
await expect(runSdkInstallerWithDefinedZipPath).rejects.toBeInstanceOf(Error);
|
|
85
|
+
expect(services_1.clean).toBeCalledTimes(1);
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
const childProcess = __importStar(require("child_process"));
|
|
23
|
+
const services_1 = require("../../../../../sdks/sdk-utils/sdk-installer/services");
|
|
24
|
+
jest.mock('child_process');
|
|
25
|
+
describe('SDK Installer - Cleaner', () => {
|
|
26
|
+
afterEach(() => {
|
|
27
|
+
jest.clearAllMocks();
|
|
28
|
+
});
|
|
29
|
+
it('removes all dirs and files listed as paths in array', () => {
|
|
30
|
+
childProcess.spawnSync.mockImplementationOnce(() => { });
|
|
31
|
+
const spawnSyncSpy = jest.spyOn(childProcess, 'spawnSync');
|
|
32
|
+
const pathsToClean = [
|
|
33
|
+
'/path/to/dir1',
|
|
34
|
+
'/path/to/dir2',
|
|
35
|
+
'/path/to/file1.zip',
|
|
36
|
+
'/path/to/file2.js',
|
|
37
|
+
];
|
|
38
|
+
services_1.clean(pathsToClean);
|
|
39
|
+
expect(spawnSyncSpy).toHaveBeenCalledTimes(pathsToClean.length);
|
|
40
|
+
const [call0, call1, call2, call3] = spawnSyncSpy.mock.calls;
|
|
41
|
+
expect(call0).toEqual(['rm', ['-r', '/path/to/dir1']]);
|
|
42
|
+
expect(call1).toEqual(['rm', ['-r', '/path/to/dir2']]);
|
|
43
|
+
expect(call2).toEqual(['rm', ['-r', '/path/to/file1.zip']]);
|
|
44
|
+
expect(call3).toEqual(['rm', ['-r', '/path/to/file2.js']]);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
const stream_1 = __importDefault(require("stream"));
|
|
26
|
+
const nock = __importStar(require("nock"));
|
|
27
|
+
const http_1 = __importDefault(require("http"));
|
|
28
|
+
const https_1 = __importDefault(require("https"));
|
|
29
|
+
const fs_1 = __importDefault(require("fs"));
|
|
30
|
+
const services_1 = require("../../../../../sdks/sdk-utils/sdk-installer/services");
|
|
31
|
+
jest.mock('fs');
|
|
32
|
+
fs_1.default.createWriteStream.mockImplementation(() => new stream_1.default.PassThrough());
|
|
33
|
+
describe('SDK Installer - Downloader', () => {
|
|
34
|
+
const HTTP_RESPONSE_STATUS_CODE_OK = 200;
|
|
35
|
+
const HTTP_RESPONSE_STATUS_CODE_NOT_FOUND = 404;
|
|
36
|
+
const httpBasePath = 'http://s3.amazonaws.com';
|
|
37
|
+
const zipRelativeFilePath = '/file.zip';
|
|
38
|
+
const zipFileHttpUrl = `${httpBasePath}${zipRelativeFilePath}`;
|
|
39
|
+
const headersWithZipContentType = { 'Content-Type': 'application/zip' };
|
|
40
|
+
const saveFilePath = `${process.cwd()}/test.zip`;
|
|
41
|
+
const makeValidHttpNock = () => nock.default(httpBasePath)
|
|
42
|
+
.get(zipRelativeFilePath)
|
|
43
|
+
.reply(HTTP_RESPONSE_STATUS_CODE_OK, '', headersWithZipContentType);
|
|
44
|
+
nock.disableNetConnect();
|
|
45
|
+
afterEach(() => {
|
|
46
|
+
jest.clearAllMocks();
|
|
47
|
+
});
|
|
48
|
+
afterAll(() => {
|
|
49
|
+
nock.cleanAll();
|
|
50
|
+
nock.enableNetConnect();
|
|
51
|
+
});
|
|
52
|
+
describe('Supported protocols', () => {
|
|
53
|
+
it('calls http.get for URL with HTTP protocol', async () => {
|
|
54
|
+
makeValidHttpNock();
|
|
55
|
+
const getSpy = jest.spyOn(http_1.default, 'get');
|
|
56
|
+
await services_1.download(zipFileHttpUrl, saveFilePath);
|
|
57
|
+
expect(getSpy).toBeCalledTimes(1);
|
|
58
|
+
});
|
|
59
|
+
it('calls https.get for URL with HTTPS protocol', async () => {
|
|
60
|
+
nock.default(httpBasePath.replace('http:', 'https:'))
|
|
61
|
+
.get(zipRelativeFilePath)
|
|
62
|
+
.reply(HTTP_RESPONSE_STATUS_CODE_OK, '', headersWithZipContentType);
|
|
63
|
+
const getSpy = jest.spyOn(https_1.default, 'get');
|
|
64
|
+
await services_1.download(zipFileHttpUrl.replace('http:', 'https:'), saveFilePath);
|
|
65
|
+
expect(getSpy).toBeCalledTimes(1);
|
|
66
|
+
});
|
|
67
|
+
it('throws an error when URL has unsupported protocol', async () => {
|
|
68
|
+
await expect(async () => {
|
|
69
|
+
await services_1.download('ftp://file.zip', saveFilePath);
|
|
70
|
+
}).rejects.toThrow(new Error('ftp: protocol is not supported'));
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
describe('Handling response errors', () => {
|
|
74
|
+
it('throws an error when returned content type is not application/zip', async () => {
|
|
75
|
+
nock.default(httpBasePath)
|
|
76
|
+
.get('/file.json')
|
|
77
|
+
.reply(HTTP_RESPONSE_STATUS_CODE_OK, '', { 'Content-Type': 'application/json' });
|
|
78
|
+
await expect(async () => {
|
|
79
|
+
await services_1.download(`${httpBasePath}/file.json`, saveFilePath);
|
|
80
|
+
}).rejects.toThrow(new Error('Wrong Content-Type: expected application/zip, received application/json'));
|
|
81
|
+
nock.default(httpBasePath)
|
|
82
|
+
.get(zipRelativeFilePath)
|
|
83
|
+
.reply(HTTP_RESPONSE_STATUS_CODE_OK, '');
|
|
84
|
+
await expect(async () => {
|
|
85
|
+
await services_1.download(zipFileHttpUrl, saveFilePath);
|
|
86
|
+
}).rejects.toThrow(new Error('Missing Content-Type: expected application/zip'));
|
|
87
|
+
});
|
|
88
|
+
it('throws an error when request status is not 200', async () => {
|
|
89
|
+
nock.default(httpBasePath)
|
|
90
|
+
.get(zipRelativeFilePath)
|
|
91
|
+
.reply(HTTP_RESPONSE_STATUS_CODE_NOT_FOUND, '', headersWithZipContentType);
|
|
92
|
+
await expect(async () => {
|
|
93
|
+
await services_1.download(zipFileHttpUrl, saveFilePath);
|
|
94
|
+
}).rejects.toThrow(new Error('Request Failed. Status Code: 404'));
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
describe('Writing received data into a file', () => {
|
|
98
|
+
beforeEach(() => {
|
|
99
|
+
makeValidHttpNock();
|
|
100
|
+
});
|
|
101
|
+
it('Creates dest path if does not exist', async () => {
|
|
102
|
+
const mkDirSync = jest.spyOn(fs_1.default, 'mkdirSync');
|
|
103
|
+
fs_1.default.existsSync.mockImplementationOnce(() => false);
|
|
104
|
+
await services_1.download(zipFileHttpUrl, saveFilePath);
|
|
105
|
+
expect(mkDirSync).toBeCalledTimes(1);
|
|
106
|
+
expect(mkDirSync).toHaveBeenCalledWith(process.cwd(), { recursive: true });
|
|
107
|
+
});
|
|
108
|
+
it('Does not create dest path if path exists', async () => {
|
|
109
|
+
const mkDirSync = jest.spyOn(fs_1.default, 'mkdirSync');
|
|
110
|
+
fs_1.default.existsSync.mockImplementationOnce(() => true);
|
|
111
|
+
await services_1.download(zipFileHttpUrl, saveFilePath);
|
|
112
|
+
expect(mkDirSync).toBeCalledTimes(0);
|
|
113
|
+
});
|
|
114
|
+
it('Calls write fn with dest param', async () => {
|
|
115
|
+
const createWriteStream = jest.spyOn(fs_1.default, 'createWriteStream');
|
|
116
|
+
await services_1.download(zipFileHttpUrl, saveFilePath);
|
|
117
|
+
expect(createWriteStream).toBeCalledTimes(1);
|
|
118
|
+
expect(createWriteStream).toHaveBeenCalledWith(saveFilePath);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
const childProcess = __importStar(require("child_process"));
|
|
23
|
+
const services_1 = require("../../../../../sdks/sdk-utils/sdk-installer/services");
|
|
24
|
+
jest.mock('child_process');
|
|
25
|
+
describe('SDK Installer - Installer', () => {
|
|
26
|
+
childProcess.execSync.mockImplementation(() => '');
|
|
27
|
+
afterEach(() => {
|
|
28
|
+
jest.clearAllMocks();
|
|
29
|
+
});
|
|
30
|
+
describe('Calling external install.js script', () => {
|
|
31
|
+
it('Calls with install.js path only when install path is not provided', () => {
|
|
32
|
+
const execSyncSpy = jest.spyOn(childProcess, 'execSync');
|
|
33
|
+
services_1.install('/install/from');
|
|
34
|
+
expect(execSyncSpy).toHaveBeenCalledTimes(1);
|
|
35
|
+
const params = execSyncSpy.mock.calls[0];
|
|
36
|
+
const command = params[0];
|
|
37
|
+
expect(command).toBe('node /install/from/install.js');
|
|
38
|
+
});
|
|
39
|
+
it('Calls with install path when it is provided', () => {
|
|
40
|
+
const execSyncSpy = jest.spyOn(childProcess, 'execSync');
|
|
41
|
+
services_1.install('/install/from', '/install/to');
|
|
42
|
+
expect(execSyncSpy).toHaveBeenCalledTimes(1);
|
|
43
|
+
const params = execSyncSpy.mock.calls[0];
|
|
44
|
+
const command = params[0];
|
|
45
|
+
expect(command).toBe('node /install/from/install.js /install/to');
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
it('returns installed path', () => {
|
|
49
|
+
childProcess.execSync.mockImplementationOnce(() => 'INSTALL_PATH=/sdk');
|
|
50
|
+
const pathInstalledTo = services_1.install('/install/from');
|
|
51
|
+
expect(pathInstalledTo).toBe('/sdk');
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
const childProcess = __importStar(require("child_process"));
|
|
23
|
+
const services_1 = require("../../../../../sdks/sdk-utils/sdk-installer/services");
|
|
24
|
+
jest.mock('child_process');
|
|
25
|
+
describe('SDK Installer - Unzipper', () => {
|
|
26
|
+
childProcess.spawnSync.mockImplementation(() => ({ stderr: '' }));
|
|
27
|
+
afterEach(() => {
|
|
28
|
+
jest.clearAllMocks();
|
|
29
|
+
});
|
|
30
|
+
it('calls spawnSync with needed params', () => {
|
|
31
|
+
const spawnSyncSpy = jest.spyOn(childProcess, 'spawnSync');
|
|
32
|
+
services_1.unzip('/path/file.zip');
|
|
33
|
+
expect(spawnSyncSpy).toHaveBeenCalledTimes(1);
|
|
34
|
+
const params = spawnSyncSpy.mock.calls[0];
|
|
35
|
+
const command = params[0];
|
|
36
|
+
expect(command).toBe('unzip');
|
|
37
|
+
const args = params[1] || [];
|
|
38
|
+
expect(args).not.toBeUndefined();
|
|
39
|
+
expect(args.includes('/path/file.zip')).toBe(true);
|
|
40
|
+
});
|
|
41
|
+
it('throws an error when error occurs during unzipping', async () => {
|
|
42
|
+
childProcess.spawnSync.mockImplementationOnce(() => ({ stderr: 'error' }));
|
|
43
|
+
expect(() => {
|
|
44
|
+
services_1.unzip('');
|
|
45
|
+
}).toThrow(new Error('error'));
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -4,7 +4,7 @@ exports.resolveBaseUrl = void 0;
|
|
|
4
4
|
const resolveGenericRnvConfig_1 = require("./resolveGenericRnvConfig");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
const resolveBaseUrl = ({ platform, scheme, flavour }) => {
|
|
7
|
-
const c =
|
|
7
|
+
const c = resolveGenericRnvConfig_1.getBaseConfig();
|
|
8
8
|
c.platform = platform;
|
|
9
9
|
c.runtime.scheme = scheme;
|
|
10
10
|
c.runtime.appId = flavour;
|
|
@@ -17,7 +17,7 @@ const getBuildVersionForFileName = (c) => {
|
|
|
17
17
|
case constants_1.BuildSchemes.RELEASE_LATEST:
|
|
18
18
|
return 'latest.release';
|
|
19
19
|
default:
|
|
20
|
-
return
|
|
20
|
+
return resolveBuildVersion_1.resolveBuildVersion({
|
|
21
21
|
platform,
|
|
22
22
|
scheme,
|
|
23
23
|
flavour: appId,
|
|
@@ -29,7 +29,7 @@ const resolveBuildFileName = (c) => {
|
|
|
29
29
|
const appNameInFileName = getConfigProp(c, platformName, 'appNameInFileName', '');
|
|
30
30
|
const buildVersion = getBuildVersionForFileName(c);
|
|
31
31
|
const appConfigId = c.runtime.appId || '';
|
|
32
|
-
const extension =
|
|
32
|
+
const extension = resolveBuildFileExtension_1.resolveBuildFileExtension(platformName);
|
|
33
33
|
return `${appNameInFileName}_${platformName}_${buildVersion}_${appConfigId}.${extension}`;
|
|
34
34
|
};
|
|
35
35
|
exports.resolveBuildFileName = resolveBuildFileName;
|
|
@@ -24,13 +24,13 @@ const resolveBuildType = (c) => {
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
const resolveVersionOffset = (c) => {
|
|
27
|
-
const versionOffsetString =
|
|
27
|
+
const versionOffsetString = resolveBuildVersionOffset_1.resolveBuildVersionOffset(c);
|
|
28
28
|
return versionOffsetString
|
|
29
29
|
? `-${versionOffsetString}`
|
|
30
30
|
: '';
|
|
31
31
|
};
|
|
32
32
|
const resolveBuildVersion = ({ platform, scheme, flavour }) => {
|
|
33
|
-
const c =
|
|
33
|
+
const c = resolveGenericRnvConfig_1.getBaseConfig();
|
|
34
34
|
c.platform = platform;
|
|
35
35
|
c.runtime.scheme = scheme;
|
|
36
36
|
c.runtime.appId = flavour;
|
|
@@ -6,14 +6,14 @@ const getCurrentGitBranchName = () => {
|
|
|
6
6
|
if (process.env.BRANCH)
|
|
7
7
|
return process.env.BRANCH;
|
|
8
8
|
const gitCommand = 'git branch --show-current';
|
|
9
|
-
return
|
|
9
|
+
return child_process_1.execSync(gitCommand, { stdio: 'pipe' }).toString().trim();
|
|
10
10
|
};
|
|
11
11
|
const getMergedPullRequestsOffsetFromBranch = (branch) => {
|
|
12
12
|
const defaultValue = '';
|
|
13
13
|
const mergeTitleRegex = '^Merge pull request #';
|
|
14
14
|
const cmd = `git rev-list --count --merges --grep="${mergeTitleRegex}" HEAD ^origin/${branch}`;
|
|
15
15
|
try {
|
|
16
|
-
const diffCount =
|
|
16
|
+
const diffCount = child_process_1.execSync(cmd, { stdio: 'pipe' }).toString().trim();
|
|
17
17
|
const diffCountNumeric = parseInt(diffCount, 10);
|
|
18
18
|
return diffCountNumeric > 0 ? String(diffCountNumeric) : defaultValue;
|
|
19
19
|
}
|
|
@@ -10,7 +10,7 @@ const resolveSupportedPlatforms_1 = require("./resolveSupportedPlatforms");
|
|
|
10
10
|
const getBuildVersion = (c) => {
|
|
11
11
|
const { platform, runtime } = c;
|
|
12
12
|
const { scheme, appId } = runtime;
|
|
13
|
-
return
|
|
13
|
+
return resolveBuildVersion_1.resolveBuildVersion({
|
|
14
14
|
platform,
|
|
15
15
|
scheme,
|
|
16
16
|
flavour: appId,
|
|
@@ -30,17 +30,17 @@ const makeOutputObject = (buildVersion = '') => ({
|
|
|
30
30
|
const makeUrls = (c, platformName, flavourName) => {
|
|
31
31
|
const isHbbTVPlatform = platformName === constants_1.Platforms.HBBTV;
|
|
32
32
|
const { scheme } = c.runtime;
|
|
33
|
-
const baseUrl =
|
|
33
|
+
const baseUrl = resolveBaseUrl_1.resolveBaseUrl({
|
|
34
34
|
platform: platformName,
|
|
35
35
|
scheme,
|
|
36
36
|
flavour: flavourName,
|
|
37
37
|
});
|
|
38
38
|
if (!baseUrl)
|
|
39
39
|
return null;
|
|
40
|
-
const packageFileName =
|
|
40
|
+
const packageFileName = resolveBuildFileName_1.resolveBuildFileName(c);
|
|
41
41
|
const packageUrl = packageFileName ? `${baseUrl}/build/${packageFileName}` : '';
|
|
42
42
|
const indexUrl = isHbbTVPlatform
|
|
43
|
-
?
|
|
43
|
+
? resolveHbbtvDeployUrl_1.resolveHbbtvDeployUrl(c, scheme, flavourName)
|
|
44
44
|
: `${baseUrl}/public/index.html`;
|
|
45
45
|
return { packageUrl, indexUrl };
|
|
46
46
|
};
|
|
@@ -73,7 +73,7 @@ const resolveDeployLocations = (c) => {
|
|
|
73
73
|
c.platform = originalPlatform;
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
-
|
|
76
|
+
resolveSupportedPlatforms_1.resolveSupportedPlatforms(c).forEach(processPlatform);
|
|
77
77
|
return output;
|
|
78
78
|
};
|
|
79
79
|
exports.resolveDeployLocations = resolveDeployLocations;
|
|
@@ -28,7 +28,7 @@ const mergeDeep_1 = require("../utils/mergeDeep");
|
|
|
28
28
|
const mergeFileJsonIntoObject = (filePath = '', targetObject = {}) => {
|
|
29
29
|
const fileContentAsString = fs.readFileSync(filePath).toString();
|
|
30
30
|
const fileContentAsJSON = JSON.parse(fileContentAsString);
|
|
31
|
-
|
|
31
|
+
mergeDeep_1.mergeDeep(targetObject, fileContentAsJSON);
|
|
32
32
|
};
|
|
33
33
|
const getBaseConfig = () => {
|
|
34
34
|
const c = rnv_1.ConfigManager.createRnvConfig({ ci: true }, process);
|
|
@@ -38,7 +38,7 @@ const getBaseConfig = () => {
|
|
|
38
38
|
mergeFileJsonIntoObject(c.paths.project.config, c.buildConfig);
|
|
39
39
|
const baseConfigPath = path.join(c.paths.project.appConfigBase.dir, 'renative.json');
|
|
40
40
|
mergeFileJsonIntoObject(baseConfigPath, c.buildConfig);
|
|
41
|
-
|
|
41
|
+
replaceRelevantStringsInConfig_1.replaceRelevantStringsInConfig(c);
|
|
42
42
|
return c;
|
|
43
43
|
};
|
|
44
44
|
exports.getBaseConfig = getBaseConfig;
|
|
@@ -4,8 +4,8 @@ exports.resolveHbbtvDeployUrl = void 0;
|
|
|
4
4
|
const resolveHbbtvRemoteBuildDirRelativePath_1 = require("./resolveHbbtvRemoteBuildDirRelativePath");
|
|
5
5
|
const resolveHbbtvDeployConfig_1 = require("./resolveHbbtvDeployConfig");
|
|
6
6
|
const resolveHbbtvDeployUrl = (c, scheme, appConfigId) => {
|
|
7
|
-
const { host } =
|
|
8
|
-
const remoteDirRelativePath =
|
|
7
|
+
const { host } = resolveHbbtvDeployConfig_1.resolveHbbtvDeployConfig();
|
|
8
|
+
const remoteDirRelativePath = resolveHbbtvRemoteBuildDirRelativePath_1.resolveHbbtvRemoteBuildDirRelativePath(c, scheme, appConfigId);
|
|
9
9
|
return `http://${host}/${remoteDirRelativePath}/public/index.html`;
|
|
10
10
|
};
|
|
11
11
|
exports.resolveHbbtvDeployUrl = resolveHbbtvDeployUrl;
|
|
@@ -4,7 +4,7 @@ exports.resolveUsedFlavours = void 0;
|
|
|
4
4
|
const resolveSupportedPlatforms_1 = require("./resolveSupportedPlatforms");
|
|
5
5
|
const resolveUsedFlavours = (rnvC) => {
|
|
6
6
|
const usedFlavours = [];
|
|
7
|
-
const supportedPlatforms =
|
|
7
|
+
const supportedPlatforms = resolveSupportedPlatforms_1.resolveSupportedPlatforms(rnvC);
|
|
8
8
|
for (let i = 0; i < supportedPlatforms.length; i++) {
|
|
9
9
|
const iPlatform = supportedPlatforms[i];
|
|
10
10
|
const iPlatformDeployConfig = rnvC.buildConfig.platforms[iPlatform]?.deploy;
|
|
@@ -6,16 +6,16 @@ const resolvers_1 = require("../resolvers");
|
|
|
6
6
|
const buildTask = (options) => {
|
|
7
7
|
const { scheme, platform, flavour } = options;
|
|
8
8
|
const cmd = `npx rnv build -s ${scheme} -p ${platform} -c ${flavour} --ci`;
|
|
9
|
-
|
|
9
|
+
child_process_1.execSync(cmd, { stdio: 'inherit' });
|
|
10
10
|
};
|
|
11
11
|
const buildAllWithScheme = () => {
|
|
12
12
|
const scheme = process.argv[2];
|
|
13
13
|
if (!scheme) {
|
|
14
14
|
throw new Error('No scheme name to use found! Please use rnv scheme name as a param.');
|
|
15
15
|
}
|
|
16
|
-
const c =
|
|
16
|
+
const c = resolvers_1.getBaseConfig();
|
|
17
17
|
c.runtime.scheme = scheme;
|
|
18
|
-
|
|
18
|
+
forEachSupportedPlatformFlavour_1.forEachSupportedPlatformFlavour(c, buildTask);
|
|
19
19
|
return true;
|
|
20
20
|
};
|
|
21
21
|
const startTimestamp = Date.now();
|
|
@@ -27,7 +27,7 @@ const fsUtils_1 = require("../utils/fsUtils");
|
|
|
27
27
|
const makeTableDataByScheme_1 = require("./makeTableDataByScheme");
|
|
28
28
|
const formatTableDataSpaces_1 = require("./formatTableDataSpaces");
|
|
29
29
|
const processOutput = (outputFilePath, fileContent) => {
|
|
30
|
-
if (!
|
|
30
|
+
if (!fsUtils_1.isDir(outputFilePath)) {
|
|
31
31
|
const dirname = path.dirname(outputFilePath);
|
|
32
32
|
fs.mkdirSync(dirname, { recursive: true });
|
|
33
33
|
}
|
|
@@ -39,8 +39,8 @@ const tableDataToMarkdown = (tableData) => {
|
|
|
39
39
|
return tableRowsMarkdown.join('\n');
|
|
40
40
|
};
|
|
41
41
|
const makeTableMarkdownByScheme = (rnvC, scheme) => {
|
|
42
|
-
const tableData =
|
|
43
|
-
const formattedTableData =
|
|
42
|
+
const tableData = makeTableDataByScheme_1.makeTableDataByScheme(rnvC, scheme);
|
|
43
|
+
const formattedTableData = formatTableDataSpaces_1.formatTableDataSpaces(tableData);
|
|
44
44
|
return tableDataToMarkdown(formattedTableData);
|
|
45
45
|
};
|
|
46
46
|
const makeMarkdownFileContentRows = (rnvC) => ([
|
|
@@ -81,7 +81,7 @@ const main = () => {
|
|
|
81
81
|
if (!outputFilePath) {
|
|
82
82
|
throw new Error('You need to provide a path to output file as an argument!');
|
|
83
83
|
}
|
|
84
|
-
const rnvC =
|
|
84
|
+
const rnvC = resolvers_1.getBaseConfig();
|
|
85
85
|
const markdownFileContentRows = makeMarkdownFileContentRows(rnvC);
|
|
86
86
|
processOutput(outputFilePath, markdownFileContentRows.join('\n'));
|
|
87
87
|
};
|
|
@@ -28,8 +28,8 @@ const makePlatformRowData = (rnvC, deployLocations, tableFlavours, platform) =>
|
|
|
28
28
|
return data;
|
|
29
29
|
};
|
|
30
30
|
const makeTablePlatformsData = (rnvC, usedFlavours) => {
|
|
31
|
-
const supportedPlatforms =
|
|
32
|
-
const deployLocations =
|
|
31
|
+
const supportedPlatforms = resolvers_1.resolveSupportedPlatforms(rnvC);
|
|
32
|
+
const deployLocations = resolvers_1.resolveDeployLocations(rnvC);
|
|
33
33
|
const data = [];
|
|
34
34
|
for (let i = 0; i < supportedPlatforms.length; i++) {
|
|
35
35
|
const platform = supportedPlatforms[i];
|
|
@@ -52,7 +52,7 @@ const makeTableDataByScheme = (rnvC, scheme) => {
|
|
|
52
52
|
const originalScheme = rnvC.runtime.scheme;
|
|
53
53
|
const tableData = [];
|
|
54
54
|
rnvC.runtime.scheme = scheme;
|
|
55
|
-
const usedFlavours =
|
|
55
|
+
const usedFlavours = resolvers_1.resolveUsedFlavours(rnvC);
|
|
56
56
|
const headerData = makeHeaderData(usedFlavours);
|
|
57
57
|
tableData.push(...headerData);
|
|
58
58
|
const tablePlatformsData = makeTablePlatformsData(rnvC, usedFlavours);
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const resolvers_1 = require("../../resolvers");
|
|
4
4
|
const gitUtils_1 = require("../utils/gitUtils");
|
|
5
|
-
const c =
|
|
5
|
+
const c = resolvers_1.getBaseConfig();
|
|
6
6
|
const { branchNames, commitTitles } = c.buildConfig.common.git;
|
|
7
7
|
const { packageVersion = '' } = c.buildConfig.common;
|
|
8
8
|
const newReleaseBranchName = branchNames.rc;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
gitUtils_1.createBranch(newReleaseBranchName);
|
|
10
|
+
gitUtils_1.checkout(newReleaseBranchName);
|
|
11
|
+
gitUtils_1.addAll();
|
|
12
12
|
const withNoVerifyFlag = true;
|
|
13
13
|
console.log('Creating commit with changed version...');
|
|
14
|
-
|
|
14
|
+
gitUtils_1.commit(commitTitles.versionBump, withNoVerifyFlag);
|
|
15
15
|
console.log(`Pushing ${newReleaseBranchName} branch...`);
|
|
16
|
-
|
|
16
|
+
gitUtils_1.push(newReleaseBranchName, withNoVerifyFlag);
|
|
17
17
|
console.log(`\nDone! The version has been bumped to ${packageVersion} and ${newReleaseBranchName} branch pushed into the remote repository.`);
|
|
18
18
|
console.log('Note: Do not forget to update release notes for upcoming release!');
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const assert_1 = require("assert");
|
|
4
4
|
const resolvers_1 = require("../../resolvers");
|
|
5
5
|
const gitUtils_1 = require("../utils/gitUtils");
|
|
6
|
-
const c =
|
|
6
|
+
const c = resolvers_1.getBaseConfig();
|
|
7
7
|
const { branchNames, commitTitles } = c.buildConfig.common.git;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
assert_1.ok(branchNames.dev);
|
|
9
|
+
assert_1.ok(branchNames.rc);
|
|
10
|
+
assert_1.ok(commitTitles.versionBump);
|
|
11
|
+
gitUtils_1.assertCurrentBranch(branchNames.dev);
|
|
12
|
+
gitUtils_1.assertEmptyStatusList();
|
|
@@ -9,7 +9,7 @@ const checkReleaseNotes = (c) => {
|
|
|
9
9
|
const fileContent = utils_1.fsUtils.getFileContentAsString(relativePath);
|
|
10
10
|
const assertFileContentRow = (expectedRowContent) => {
|
|
11
11
|
const errorMsg = `${relativePath} should contain following row: "${expectedRowContent}"`;
|
|
12
|
-
|
|
12
|
+
assert_1.ok(fileContent.includes(expectedRowContent), errorMsg);
|
|
13
13
|
};
|
|
14
14
|
requiredRows.forEach(assertFileContentRow);
|
|
15
15
|
};
|