datagrok-tools 4.12.0 → 4.12.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.
@@ -134,21 +134,32 @@ function test(args) {
134
134
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
135
135
  return testUtils.runWithTimeout(timeout, /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
136
136
  var _process$env$TARGET_P;
137
- var targetPackage, r;
137
+ var consoleLog, targetPackage, r;
138
138
  return _regenerator["default"].wrap(function _callee2$(_context2) {
139
139
  while (1) {
140
140
  switch (_context2.prev = _context2.next) {
141
141
  case 0:
142
+ consoleLog = '';
142
143
  if (!options.record) {
143
- _context2.next = 3;
144
+ _context2.next = 7;
144
145
  break;
145
146
  }
146
- _context2.next = 3;
147
+ _context2.next = 4;
147
148
  return recorder.start('./test-record.mp4');
148
- case 3:
149
+ case 4:
150
+ page.on('console', function (msg) {
151
+ return consoleLog += "CONSOLE LOG ENTRY: ".concat(msg.text(), "\n");
152
+ });
153
+ page.on('pageerror', function (error) {
154
+ consoleLog += "CONSOLE LOG ERROR: ".concat(error.message, "\n");
155
+ });
156
+ page.on('response', function (response) {
157
+ consoleLog += "CONSOLE LOG REQUEST: ".concat(response.status(), ", ").concat(response.url(), "\n");
158
+ });
159
+ case 7:
149
160
  targetPackage = (_process$env$TARGET_P = process.env.TARGET_PACKAGE) !== null && _process$env$TARGET_P !== void 0 ? _process$env$TARGET_P : '#{PACKAGE_NAMESPACE}';
150
161
  console.log("Testing ".concat(targetPackage, " package...\n"));
151
- _context2.next = 7;
162
+ _context2.next = 11;
152
163
  return page.evaluate(function (targetPackage, options, testContext) {
153
164
  return new Promise(function (resolve, reject) {
154
165
  window.grok.functions.call("".concat(targetPackage, ":test"), {
@@ -200,17 +211,19 @@ function test(args) {
200
211
  });
201
212
  });
202
213
  }, targetPackage, options, new testUtils.TestContext(options.catchUnhandled, options.report));
203
- case 7:
214
+ case 11:
204
215
  r = _context2.sent;
205
216
  if (!options.record) {
206
- _context2.next = 11;
217
+ _context2.next = 16;
207
218
  break;
208
219
  }
209
- _context2.next = 11;
220
+ _context2.next = 15;
210
221
  return recorder.stop();
211
- case 11:
222
+ case 15:
223
+ _fs["default"].writeFileSync('./test-console-output.log', consoleLog);
224
+ case 16:
212
225
  return _context2.abrupt("return", r);
213
- case 12:
226
+ case 17:
214
227
  case "end":
215
228
  return _context2.stop();
216
229
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datagrok-tools",
3
- "version": "4.12.0",
3
+ "version": "4.12.2",
4
4
  "description": "Utility to upload and publish packages to Datagrok",
5
5
  "homepage": "https://github.com/datagrok-ai/public/tree/master/tools#readme",
6
6
  "dependencies": {
@@ -24,7 +24,8 @@
24
24
  "scripts": {
25
25
  "link": "npm link",
26
26
  "prepublishOnly": "babel bin --extensions .ts -d bin",
27
- "babel": "babel bin --extensions .ts -d bin"
27
+ "babel": "babel bin --extensions .ts -d bin",
28
+ "build": "babel bin --extensions .ts -d bin"
28
29
  },
29
30
  "bin": {
30
31
  "datagrok-upload": "./bin/_deprecated/upload.js",
@@ -86,7 +86,7 @@ class FuncGeneratorPlugin {
86
86
  for (let i = 0; i < imports.length; i++) {
87
87
  const importStatement = imports[i];
88
88
  const exportStatement = exports[i];
89
- if (!content.includes(importStatement))
89
+ if (!content.includes(importStatement.trim()))
90
90
  content = importStatement + content + exportStatement;
91
91
  }
92
92
  fs.writeFileSync(filePath, content, 'utf-8');