powerbi-visuals-tools 5.0.1 → 5.0.3
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/Changelog.md +7 -0
- package/bin/pbiviz.js +9 -4
- package/certs/PowerBICustomVisualTest_private.key +26 -26
- package/certs/PowerBICustomVisualTest_public.crt +17 -17
- package/lib/CertificateTools.js +2 -2
- package/lib/CommandManager.js +4 -0
- package/lib/WebPackWrap.js +3 -3
- package/lib/webpack.config.js +35 -31
- package/package.json +5 -5
- package/spec/.jshintrc +0 -5
- package/spec/clean-tests.js +0 -31
- package/spec/e2e/pbivizCertSpec.js +0 -57
- package/spec/e2e/pbivizInfoSpec.js +0 -79
- package/spec/e2e/pbivizNewSpec.js +0 -253
- package/spec/e2e/pbivizPackageSpec.js +0 -686
- package/spec/e2e/pbivizStartSpec.js +0 -406
- package/spec/e2e/pbivizWebpackVerSpec.js +0 -100
- package/spec/e2e/testUtils.js +0 -60
- package/spec/helpers/FileSystem.js +0 -173
- package/spec/jasmine-runner.js +0 -36
- package/spec/support/jasmine.json +0 -11
- package/src/CertificateTools.ts +0 -431
- package/src/CommandManager.ts +0 -78
- package/src/ConsoleWriter.ts +0 -206
- package/src/TemplateFetcher.ts +0 -122
- package/src/VisualGenerator.ts +0 -236
- package/src/VisualManager.ts +0 -220
- package/src/WebPackWrap.ts +0 -299
- package/src/utils.ts +0 -40
- package/src/webpack.config.ts +0 -145
package/Changelog.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
This page contains information about changes to the PowerBI Visual Tools (pbiviz).
|
|
4
4
|
|
|
5
|
+
## 5.0.3
|
|
6
|
+
* Now option `--install-cert` is command. New usage is `pbiviz install-cert`
|
|
7
|
+
* Fixed bug with the incorrect detection of the installed API version
|
|
8
|
+
|
|
9
|
+
## 5.0.2
|
|
10
|
+
* Implemented common solution for webpack loaders on different environments
|
|
11
|
+
|
|
5
12
|
## 5.0.1
|
|
6
13
|
* Fixed broken imports in webpack.config for some cases
|
|
7
14
|
|
package/bin/pbiviz.js
CHANGED
|
@@ -27,19 +27,16 @@
|
|
|
27
27
|
|
|
28
28
|
"use strict";
|
|
29
29
|
|
|
30
|
-
import { createCertificate } from "../lib/CertificateTools.js";
|
|
31
30
|
import ConsoleWriter from '../lib/ConsoleWriter.js';
|
|
32
31
|
import CommandManager from '../lib/CommandManager.js';
|
|
33
32
|
import { readJsonFromRoot } from '../lib/utils.js';
|
|
34
|
-
import {
|
|
33
|
+
import { program, Option } from 'commander';
|
|
35
34
|
|
|
36
35
|
const npmPackage = readJsonFromRoot('package.json');
|
|
37
36
|
const rootPath = process.cwd();
|
|
38
|
-
const program = new Command();
|
|
39
37
|
|
|
40
38
|
const pbiviz = program
|
|
41
39
|
.version(npmPackage.version)
|
|
42
|
-
.option('--install-cert', 'Creates and installs localhost certificate', createCertificate)
|
|
43
40
|
.showHelpAfterError('Run "pbiviz help" for usage instructions.')
|
|
44
41
|
.addHelpText('beforeAll', ConsoleWriter.info(`${npmPackage.name} version - ${npmPackage.version}`))
|
|
45
42
|
.addHelpText('before', ConsoleWriter.getLogoVisualization());
|
|
@@ -59,9 +56,17 @@ pbiviz
|
|
|
59
56
|
|
|
60
57
|
pbiviz
|
|
61
58
|
.command('info')
|
|
59
|
+
.description('Displays visual info')
|
|
62
60
|
.action(() => {
|
|
63
61
|
CommandManager.info(rootPath);
|
|
64
62
|
});
|
|
63
|
+
|
|
64
|
+
pbiviz
|
|
65
|
+
.command('install-cert')
|
|
66
|
+
.description('Creates and installs localhost certificate')
|
|
67
|
+
.action(() => {
|
|
68
|
+
CommandManager.installCert();
|
|
69
|
+
});
|
|
65
70
|
|
|
66
71
|
pbiviz
|
|
67
72
|
.command('start')
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
-----BEGIN PRIVATE KEY-----
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|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zzo+PrFO9YeM4ZyJrwLRTSlWTudjfmMRwIMKmhWo/tFo+e5+IZ
|
|
14
|
+
uYaXYWCtyQSz6fb/XF1RlbmeBd4NhT81mITh9h8s7Hjece1UX73Gc5n2uZr7sokl
|
|
15
|
+
9D+rcXPPKhrCvNAuRIEcQSKpueKcADizT/KFDjqX5DhztiiZmk62Ki/K+aTWSl0q
|
|
16
|
+
Pj3s0KNBCL8sUecvjGoaxNamJ3v22tYmKPi5G79suat5kvEjkndU+F0Y/EM5lwsH
|
|
17
|
+
whChIjCR4RBU01pPG6S2zzvgNUrVHc7W7CsSX55U641oHd9r5gLkBQ0t9Sa5xXqd
|
|
18
|
+
saWvwAR8yKA6G+t5PQ==
|
|
19
19
|
-----END CERTIFICATE-----
|
package/lib/CertificateTools.js
CHANGED
|
@@ -221,7 +221,7 @@ async function getCertFile(config, silent) {
|
|
|
221
221
|
return pfx;
|
|
222
222
|
}
|
|
223
223
|
if (!silent) {
|
|
224
|
-
ConsoleWriter.info('Certificate not found. Call `pbiviz
|
|
224
|
+
ConsoleWriter.info('Certificate not found. Call `pbiviz install-cert` command to create the new certificate');
|
|
225
225
|
}
|
|
226
226
|
return null;
|
|
227
227
|
}
|
|
@@ -323,7 +323,7 @@ export async function resolveCertificate() {
|
|
|
323
323
|
await createCertFile(config, true);
|
|
324
324
|
if (!(await getCertFile(config, true))) {
|
|
325
325
|
ConsoleWriter.error('Certificate wasn\'t created');
|
|
326
|
-
throw new Error("Call `pbiviz
|
|
326
|
+
throw new Error("Call `pbiviz install-cert` command to create the new certificate");
|
|
327
327
|
}
|
|
328
328
|
else {
|
|
329
329
|
if (config.server.passphrase) {
|
package/lib/CommandManager.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createCertificate } from './CertificateTools.js';
|
|
1
2
|
import ConsoleWriter from './ConsoleWriter.js';
|
|
2
3
|
import VisualManager from './VisualManager.js';
|
|
3
4
|
export default class CommandManager {
|
|
@@ -49,4 +50,7 @@ export default class CommandManager {
|
|
|
49
50
|
.prepareVisual()
|
|
50
51
|
.displayInfo();
|
|
51
52
|
}
|
|
53
|
+
static async installCert() {
|
|
54
|
+
await createCertificate();
|
|
55
|
+
}
|
|
52
56
|
}
|
package/lib/WebPackWrap.js
CHANGED
|
@@ -12,7 +12,7 @@ import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
|
|
|
12
12
|
import { PowerBICustomVisualsWebpackPlugin } from 'powerbi-visuals-webpack-plugin';
|
|
13
13
|
import ConsoleWriter from './ConsoleWriter.js';
|
|
14
14
|
import { resolveCertificate } from "./CertificateTools.js";
|
|
15
|
-
import {
|
|
15
|
+
import { readJsonFromRoot, readJsonFromVisual } from './utils.js';
|
|
16
16
|
const config = readJsonFromRoot('config.json');
|
|
17
17
|
const npmPackage = readJsonFromRoot('package.json');
|
|
18
18
|
const visualPlugin = "visualPlugin.ts";
|
|
@@ -117,7 +117,7 @@ export default class WebPackWrap {
|
|
|
117
117
|
async configureCustomVisualsWebpackPlugin(visualPackage, options, tsconfig) {
|
|
118
118
|
const pluginConfiguration = lodashCloneDeep(visualPackage.pbivizConfig);
|
|
119
119
|
//(?=\D*$) - positive look-ahead to find last version symbols and exclude any non-digit symbols after the version.
|
|
120
|
-
const regexFullVersion = /(?:\d+\.?){1,3}
|
|
120
|
+
const regexFullVersion = /(?<=powerbi-visuals-api@)((?:\d+\.?){1,3})/g;
|
|
121
121
|
const regexMinorVersion = /\d+(?:\.\d+)?/;
|
|
122
122
|
let apiVersionInstalled;
|
|
123
123
|
try {
|
|
@@ -189,7 +189,7 @@ export default class WebPackWrap {
|
|
|
189
189
|
test: /(\.ts)x?$/,
|
|
190
190
|
use: [
|
|
191
191
|
{
|
|
192
|
-
loader:
|
|
192
|
+
loader: "ts-loader",
|
|
193
193
|
options: tsOptions
|
|
194
194
|
}
|
|
195
195
|
]
|
package/lib/webpack.config.js
CHANGED
|
@@ -37,7 +37,7 @@ const webpackConfig = {
|
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
test: /\.json$/,
|
|
40
|
-
loader:
|
|
40
|
+
loader: "json-loader",
|
|
41
41
|
type: "javascript/auto"
|
|
42
42
|
},
|
|
43
43
|
{
|
|
@@ -47,10 +47,10 @@ const webpackConfig = {
|
|
|
47
47
|
loader: MiniCssExtractPlugin.loader
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
|
-
loader:
|
|
50
|
+
loader: "css-loader"
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
|
-
loader:
|
|
53
|
+
loader: "less-loader",
|
|
54
54
|
options: {
|
|
55
55
|
lessOptions: {
|
|
56
56
|
paths: [path.resolve(rootPath, 'node_modules')]
|
|
@@ -69,40 +69,44 @@ const webpackConfig = {
|
|
|
69
69
|
}
|
|
70
70
|
]
|
|
71
71
|
},
|
|
72
|
+
resolveLoader: {
|
|
73
|
+
modules: ['node_modules', path.resolve(rootPath, 'node_modules')],
|
|
74
|
+
},
|
|
72
75
|
externals: {
|
|
73
76
|
"powerbi-visuals-api": 'null'
|
|
74
77
|
},
|
|
75
78
|
resolve: {
|
|
76
79
|
extensions: ['.tsx', '.ts', '.jsx', '.js', '.css'],
|
|
80
|
+
modules: ['node_modules', path.resolve(rootPath, 'node_modules')],
|
|
77
81
|
fallback: {
|
|
78
|
-
assert:
|
|
79
|
-
buffer:
|
|
80
|
-
console:
|
|
81
|
-
constants:
|
|
82
|
-
crypto:
|
|
83
|
-
domain:
|
|
84
|
-
events:
|
|
85
|
-
http:
|
|
86
|
-
https:
|
|
87
|
-
os:
|
|
88
|
-
path:
|
|
89
|
-
punycode:
|
|
90
|
-
process:
|
|
91
|
-
querystring:
|
|
92
|
-
stream:
|
|
93
|
-
_stream_duplex:
|
|
94
|
-
_stream_passthrough:
|
|
95
|
-
_stream_readable:
|
|
96
|
-
_stream_transform:
|
|
97
|
-
_stream_writable:
|
|
98
|
-
string_decoder:
|
|
99
|
-
sys:
|
|
100
|
-
timers:
|
|
101
|
-
tty:
|
|
102
|
-
url:
|
|
103
|
-
util:
|
|
104
|
-
vm:
|
|
105
|
-
zlib:
|
|
82
|
+
assert: "assert",
|
|
83
|
+
buffer: "buffer",
|
|
84
|
+
console: "console-browserify",
|
|
85
|
+
constants: "constants-browserify",
|
|
86
|
+
crypto: "crypto-browserify",
|
|
87
|
+
domain: "domain-browser",
|
|
88
|
+
events: "events",
|
|
89
|
+
http: "stream-http",
|
|
90
|
+
https: "https-browserify",
|
|
91
|
+
os: "os-browserify",
|
|
92
|
+
path: "path-browserify",
|
|
93
|
+
punycode: "punycode",
|
|
94
|
+
process: "process",
|
|
95
|
+
querystring: "querystring-es3",
|
|
96
|
+
stream: "stream-browserify",
|
|
97
|
+
_stream_duplex: "readable-stream",
|
|
98
|
+
_stream_passthrough: "readable-stream",
|
|
99
|
+
_stream_readable: "readable-stream",
|
|
100
|
+
_stream_transform: "readable-stream",
|
|
101
|
+
_stream_writable: "readable-stream",
|
|
102
|
+
string_decoder: "string_decoder",
|
|
103
|
+
sys: "util",
|
|
104
|
+
timers: "timers-browserify",
|
|
105
|
+
tty: "tty-browserify",
|
|
106
|
+
url: "url",
|
|
107
|
+
util: "util",
|
|
108
|
+
vm: "vm-browserify",
|
|
109
|
+
zlib: "browserify-zlib"
|
|
106
110
|
}
|
|
107
111
|
},
|
|
108
112
|
output: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "powerbi-visuals-tools",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.3",
|
|
4
4
|
"description": "Command line tool for creating and publishing visuals for Power BI",
|
|
5
5
|
"main": "./bin/pbiviz.js",
|
|
6
6
|
"type": "module",
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"css-loader": "^6.8.1",
|
|
44
44
|
"domain-browser": "^4.22.0",
|
|
45
45
|
"events": "^3.3.0",
|
|
46
|
-
"terser-webpack-plugin": "^5.3.9",
|
|
47
46
|
"extra-watch-webpack-plugin": "^1.0.3",
|
|
48
47
|
"fs-extra": "^11.1.1",
|
|
49
48
|
"https-browserify": "^1.0.0",
|
|
@@ -66,9 +65,10 @@
|
|
|
66
65
|
"stream-browserify": "^3.0.0",
|
|
67
66
|
"stream-http": "^3.2.0",
|
|
68
67
|
"string_decoder": "^1.3.0",
|
|
68
|
+
"terser-webpack-plugin": "^5.3.9",
|
|
69
69
|
"timers-browserify": "^2.0.12",
|
|
70
70
|
"ts-loader": "^9.4.4",
|
|
71
|
-
"tty-browserify": "0.0.1",
|
|
71
|
+
"tty-browserify": "^0.0.1",
|
|
72
72
|
"typescript": "^4.9.5",
|
|
73
73
|
"url": "^0.11.1",
|
|
74
74
|
"util": "^0.12.5",
|
|
@@ -78,13 +78,13 @@
|
|
|
78
78
|
"webpack-dev-server": "^4.15.1"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
+
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
81
82
|
"eslint": "^8.45.0",
|
|
83
|
+
"eslint-plugin-powerbi-visuals": "^0.8.1",
|
|
82
84
|
"jasmine": "5.0.2",
|
|
83
85
|
"jasmine-spec-reporter": "7.0.0",
|
|
84
86
|
"semver": "7.5.4",
|
|
85
87
|
"tree-kill": "1.2.2",
|
|
86
|
-
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
87
|
-
"eslint-plugin-powerbi-visuals": "^0.8.1",
|
|
88
88
|
"webpack-cli": "^5.1.4"
|
|
89
89
|
},
|
|
90
90
|
"optionalDependencies": {
|
package/spec/.jshintrc
DELETED
package/spec/clean-tests.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Power BI Visual CLI
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) Microsoft Corporation
|
|
5
|
-
* All rights reserved.
|
|
6
|
-
* MIT License
|
|
7
|
-
*
|
|
8
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
-
* of this software and associated documentation files (the ""Software""), to deal
|
|
10
|
-
* in the Software without restriction, including without limitation the rights
|
|
11
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
-
* furnished to do so, subject to the following conditions:
|
|
14
|
-
*
|
|
15
|
-
* The above copyright notice and this permission notice shall be included in
|
|
16
|
-
* all copies or substantial portions of the Software.
|
|
17
|
-
*
|
|
18
|
-
* THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
|
-
* THE SOFTWARE.
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
"use strict";
|
|
28
|
-
|
|
29
|
-
import FileSystem from './helpers/FileSystem.js';
|
|
30
|
-
|
|
31
|
-
FileSystem.deleteTempDirectory();
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Power BI Visual CLI
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) Microsoft Corporation
|
|
5
|
-
* All rights reserved.
|
|
6
|
-
* MIT License
|
|
7
|
-
*
|
|
8
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
-
* of this software and associated documentation files (the ""Software""), to deal
|
|
10
|
-
* in the Software without restriction, including without limitation the rights
|
|
11
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
-
* furnished to do so, subject to the following conditions:
|
|
14
|
-
*
|
|
15
|
-
* The above copyright notice and this permission notice shall be included in
|
|
16
|
-
* all copies or substantial portions of the Software.
|
|
17
|
-
*
|
|
18
|
-
* THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
|
-
* THE SOFTWARE.
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
"use strict";
|
|
28
|
-
|
|
29
|
-
import fs from 'fs-extra';
|
|
30
|
-
import path from 'path';
|
|
31
|
-
import { getRootPath, readJsonFromRoot } from '../../lib/utils.js';
|
|
32
|
-
import { createCertFile } from '../../lib/CertificateTools.js';
|
|
33
|
-
|
|
34
|
-
const config = readJsonFromRoot('config.json');
|
|
35
|
-
|
|
36
|
-
describe("E2E - pbiviz --install-cert", () => {
|
|
37
|
-
beforeEach((done) => {
|
|
38
|
-
createCertFile(config, false).then(done);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
describe("pbiviz", () => {
|
|
42
|
-
it("pbiviz --install-cert command should generate certificate", (done) => {
|
|
43
|
-
const rootPath = getRootPath();
|
|
44
|
-
const certPath = path.join(rootPath, config.server.certificate);
|
|
45
|
-
const keyPath = path.join(rootPath, config.server.privateKey);
|
|
46
|
-
const pfxPath = path.join(rootPath, config.server.pfx);
|
|
47
|
-
const certExists = fs.existsSync(certPath);
|
|
48
|
-
const keyExists = fs.existsSync(keyPath);
|
|
49
|
-
const pfxExists = fs.existsSync(pfxPath);
|
|
50
|
-
|
|
51
|
-
const result = (certExists && keyExists) || pfxExists;
|
|
52
|
-
|
|
53
|
-
expect(result).toBeTruthy();
|
|
54
|
-
done();
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
});
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Power BI Visual CLI
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) Microsoft Corporation
|
|
5
|
-
* All rights reserved.
|
|
6
|
-
* MIT License
|
|
7
|
-
*
|
|
8
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
-
* of this software and associated documentation files (the ""Software""), to deal
|
|
10
|
-
* in the Software without restriction, including without limitation the rights
|
|
11
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
-
* furnished to do so, subject to the following conditions:
|
|
14
|
-
*
|
|
15
|
-
* The above copyright notice and this permission notice shall be included in
|
|
16
|
-
* all copies or substantial portions of the Software.
|
|
17
|
-
*
|
|
18
|
-
* THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
|
-
* THE SOFTWARE.
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
"use strict";
|
|
28
|
-
|
|
29
|
-
import fs from 'fs-extra';
|
|
30
|
-
import path from 'path';
|
|
31
|
-
import FileSystem from '../helpers/FileSystem.js';
|
|
32
|
-
import { writeMetadata } from "./testUtils.js";
|
|
33
|
-
|
|
34
|
-
const tempPath = FileSystem.getTempPath();
|
|
35
|
-
const startPath = process.cwd();
|
|
36
|
-
|
|
37
|
-
describe("E2E - pbiviz info", () => {
|
|
38
|
-
|
|
39
|
-
const visualName = 'myvisualname';
|
|
40
|
-
const visualPath = path.join(tempPath, visualName);
|
|
41
|
-
|
|
42
|
-
beforeEach(() => {
|
|
43
|
-
process.chdir(startPath);
|
|
44
|
-
FileSystem.resetTempDirectory();
|
|
45
|
-
process.chdir(tempPath);
|
|
46
|
-
FileSystem.runPbiviz('new', visualName);
|
|
47
|
-
process.chdir(visualPath);
|
|
48
|
-
|
|
49
|
-
writeMetadata(visualPath);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
afterAll(() => {
|
|
53
|
-
process.chdir(startPath);
|
|
54
|
-
FileSystem.deleteTempDirectory();
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it("Should throw error if not in the visual root", () => {
|
|
58
|
-
let error;
|
|
59
|
-
process.chdir(tempPath);
|
|
60
|
-
|
|
61
|
-
try {
|
|
62
|
-
FileSystem.runPbiviz('info');
|
|
63
|
-
} catch (e) {
|
|
64
|
-
error = e;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
expect(error).toBeDefined();
|
|
68
|
-
expect(error.status).toBe(1);
|
|
69
|
-
expect(error.message).toContain("Error: pbiviz.json not found. You must be in the root of a visual project to run this command");
|
|
70
|
-
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
it("Should output visual info", () => {
|
|
74
|
-
const output = FileSystem.runPbiviz('info').toString();
|
|
75
|
-
const visualConfig = fs.readJsonSync(path.join(visualPath, 'pbiviz.json')).visual;
|
|
76
|
-
expect(output).toContain(visualName);
|
|
77
|
-
expect(output).toContain(visualConfig.guid);
|
|
78
|
-
});
|
|
79
|
-
});
|