powerbi-visuals-tools 5.0.0 → 5.0.2
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 +6 -0
- package/certs/PowerBICustomVisualTest_private.key +26 -26
- package/certs/PowerBICustomVisualTest_public.crt +17 -17
- package/lib/WebPackWrap.js +2 -2
- package/lib/utils.js +3 -4
- package/lib/webpack.config.js +38 -33
- package/package.json +6 -6
- 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 -41
- package/src/webpack.config.ts +0 -144
package/Changelog.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
This page contains information about changes to the PowerBI Visual Tools (pbiviz).
|
|
4
4
|
|
|
5
|
+
## 5.0.2
|
|
6
|
+
* Implemented common solution for webpack loaders on different environments
|
|
7
|
+
|
|
8
|
+
## 5.0.1
|
|
9
|
+
* Fixed broken imports in webpack.config for some cases
|
|
10
|
+
|
|
5
11
|
## 5.0.0
|
|
6
12
|
* Migrated to TypeScript
|
|
7
13
|
* Migrated to eslint
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
-----BEGIN PRIVATE KEY-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wEB/zANBgkqhkiG9w0BAQsFAAOCAQEAjJ78
|
|
13
|
+
8iUuC1JEuCpgNeD3xQtZGaOFxrpoTgqsOKhXETQ5D0vQi32elHONaknzmlRIgzuN
|
|
14
|
+
KaBWSfZ1pjiWx2rnU0n9MzULLRKbyYNjj9FvfZv/twNS6uvbJQQp8aLvqNOE5+ge
|
|
15
|
+
wqA++cdPc0jUH0n0+35luIU3EUVIs9LlXQM+E6oSnZ72QCB2f0kIAENVapZgERhG
|
|
16
|
+
3/OCPm9OAwpT8Uq+XEqXmdnslcJ1URbkQ6PHlMGuP5AMVB0p9gwVkd4S55d40i9h
|
|
17
|
+
GlxakNGKGg6HNyz/SGmQSmjl4W1lGhgyT7J3NUhSIMjqc6JXF4eoHuKgtBouRh7D
|
|
18
|
+
kaDRt73qYpB3iYQzcA==
|
|
19
19
|
-----END CERTIFICATE-----
|
package/lib/WebPackWrap.js
CHANGED
|
@@ -6,12 +6,12 @@ import webpack from 'webpack';
|
|
|
6
6
|
import util from 'util';
|
|
7
7
|
const exec = util.promisify(processExec);
|
|
8
8
|
import { exec as processExec } from 'child_process';
|
|
9
|
+
import lodashCloneDeep from 'lodash.clonedeep';
|
|
9
10
|
import ExtraWatchWebpackPlugin from 'extra-watch-webpack-plugin';
|
|
10
11
|
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
|
|
11
12
|
import { PowerBICustomVisualsWebpackPlugin } from 'powerbi-visuals-webpack-plugin';
|
|
12
13
|
import ConsoleWriter from './ConsoleWriter.js';
|
|
13
14
|
import { resolveCertificate } from "./CertificateTools.js";
|
|
14
|
-
import lodashCloneDeep from 'lodash.clonedeep';
|
|
15
15
|
import { readJsonFromRoot, readJsonFromVisual } from './utils.js';
|
|
16
16
|
const config = readJsonFromRoot('config.json');
|
|
17
17
|
const npmPackage = readJsonFromRoot('package.json');
|
|
@@ -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/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'fs-extra';
|
|
2
2
|
import https from "https";
|
|
3
3
|
import path from "path";
|
|
4
|
-
import
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
5
|
export function download(url, pathToFile) {
|
|
6
6
|
return new Promise((resolve, reject) => {
|
|
7
7
|
const fileStream = fs.createWriteStream(pathToFile);
|
|
@@ -19,9 +19,8 @@ export function createFolder(folderName) {
|
|
|
19
19
|
return folder;
|
|
20
20
|
}
|
|
21
21
|
export function getRootPath() {
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
return path.join(pathToDirectory, "../..");
|
|
22
|
+
const pathToDirectory = fileURLToPath(import.meta.url);
|
|
23
|
+
return path.join(pathToDirectory, "..", "..");
|
|
25
24
|
}
|
|
26
25
|
export function readFileFromRoot(filePath) {
|
|
27
26
|
return fs.readFileSync(path.join(getRootPath(), filePath), "utf8");
|
package/lib/webpack.config.js
CHANGED
|
@@ -5,6 +5,7 @@ import TerserPlugin from "terser-webpack-plugin";
|
|
|
5
5
|
import path from "path";
|
|
6
6
|
import webpack from "webpack";
|
|
7
7
|
const config = readJsonFromRoot("/config.json");
|
|
8
|
+
const rootPath = getRootPath();
|
|
8
9
|
const webpackConfig = {
|
|
9
10
|
entry: {
|
|
10
11
|
'visual.js': ['./src/visual.ts']
|
|
@@ -36,7 +37,7 @@ const webpackConfig = {
|
|
|
36
37
|
},
|
|
37
38
|
{
|
|
38
39
|
test: /\.json$/,
|
|
39
|
-
loader:
|
|
40
|
+
loader: "json-loader",
|
|
40
41
|
type: "javascript/auto"
|
|
41
42
|
},
|
|
42
43
|
{
|
|
@@ -46,13 +47,13 @@ const webpackConfig = {
|
|
|
46
47
|
loader: MiniCssExtractPlugin.loader
|
|
47
48
|
},
|
|
48
49
|
{
|
|
49
|
-
loader:
|
|
50
|
+
loader: "css-loader"
|
|
50
51
|
},
|
|
51
52
|
{
|
|
52
|
-
loader:
|
|
53
|
+
loader: "less-loader",
|
|
53
54
|
options: {
|
|
54
55
|
lessOptions: {
|
|
55
|
-
paths: [path.resolve(
|
|
56
|
+
paths: [path.resolve(rootPath, 'node_modules')]
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
}
|
|
@@ -68,40 +69,44 @@ const webpackConfig = {
|
|
|
68
69
|
}
|
|
69
70
|
]
|
|
70
71
|
},
|
|
72
|
+
resolveLoader: {
|
|
73
|
+
modules: ['node_modules', path.resolve(rootPath, 'node_modules')],
|
|
74
|
+
},
|
|
71
75
|
externals: {
|
|
72
76
|
"powerbi-visuals-api": 'null'
|
|
73
77
|
},
|
|
74
78
|
resolve: {
|
|
75
79
|
extensions: ['.tsx', '.ts', '.jsx', '.js', '.css'],
|
|
80
|
+
modules: ['node_modules', path.resolve(rootPath, 'node_modules')],
|
|
76
81
|
fallback: {
|
|
77
|
-
assert:
|
|
78
|
-
buffer:
|
|
79
|
-
console:
|
|
80
|
-
constants:
|
|
81
|
-
crypto:
|
|
82
|
-
domain:
|
|
83
|
-
events:
|
|
84
|
-
http:
|
|
85
|
-
https:
|
|
86
|
-
os:
|
|
87
|
-
path:
|
|
88
|
-
punycode:
|
|
89
|
-
process:
|
|
90
|
-
querystring:
|
|
91
|
-
stream:
|
|
92
|
-
_stream_duplex:
|
|
93
|
-
_stream_passthrough:
|
|
94
|
-
_stream_readable:
|
|
95
|
-
_stream_transform:
|
|
96
|
-
_stream_writable:
|
|
97
|
-
string_decoder:
|
|
98
|
-
sys:
|
|
99
|
-
timers:
|
|
100
|
-
tty:
|
|
101
|
-
url:
|
|
102
|
-
util:
|
|
103
|
-
vm:
|
|
104
|
-
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"
|
|
105
110
|
}
|
|
106
111
|
},
|
|
107
112
|
output: {
|
|
@@ -124,7 +129,7 @@ const webpackConfig = {
|
|
|
124
129
|
}
|
|
125
130
|
},
|
|
126
131
|
watchOptions: {
|
|
127
|
-
ignored: ['node_modules
|
|
132
|
+
ignored: ['node_modules", "**']
|
|
128
133
|
},
|
|
129
134
|
plugins: [
|
|
130
135
|
new webpack.ProvidePlugin({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "powerbi-visuals-tools",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.2",
|
|
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",
|
|
@@ -58,7 +57,7 @@
|
|
|
58
57
|
"mini-css-extract-plugin": "^2.7.6",
|
|
59
58
|
"os-browserify": "^0.3.0",
|
|
60
59
|
"path-browserify": "^1.0.1",
|
|
61
|
-
"powerbi-visuals-webpack-plugin": "
|
|
60
|
+
"powerbi-visuals-webpack-plugin": "4.0.1",
|
|
62
61
|
"process": "^0.11.10",
|
|
63
62
|
"punycode": "^2.3.0",
|
|
64
63
|
"querystring-es3": "^0.2.1",
|
|
@@ -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
|
-
});
|