datagrok-tools 4.7.5 → 4.7.7
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/bin/commands/add.js +1 -18
- package/bin/commands/test.js +2 -0
- package/bin/utils/test-utils.js +6 -0
- package/package.json +1 -1
package/bin/commands/add.js
CHANGED
|
@@ -375,29 +375,12 @@ function add(args) {
|
|
|
375
375
|
Object.assign(packageObj.dependencies, {
|
|
376
376
|
'@datagrok-libraries/utils': 'latest'
|
|
377
377
|
});
|
|
378
|
-
Object.assign(packageObj.devDependencies, {
|
|
379
|
-
'jest-html-reporter': '^3.5.0',
|
|
380
|
-
'jest': '^27.0.0',
|
|
381
|
-
'@types/jest': '^27.0.0',
|
|
382
|
-
'js-yaml': '^4.1.0',
|
|
383
|
-
'@types/js-yaml': "^4.0.5",
|
|
384
|
-
'@types/node-fetch': '^2.6.2',
|
|
385
|
-
'node-fetch': '^2.6.7'
|
|
386
|
-
}, ts ? {
|
|
387
|
-
'ts-jest': '^27.0.0',
|
|
388
|
-
'puppeteer': '^13.7.0'
|
|
389
|
-
} : {});
|
|
390
378
|
Object.assign(packageObj.scripts, {
|
|
391
|
-
'test': '
|
|
379
|
+
'test': 'grok test'
|
|
392
380
|
});
|
|
393
381
|
|
|
394
382
|
_fs["default"].writeFileSync(packagePath, JSON.stringify(packageObj, null, 2), 'utf8');
|
|
395
383
|
|
|
396
|
-
if (!_fs["default"].existsSync(_path["default"].join(curDir, 'jest.config.js'))) _fs["default"].writeFileSync(_path["default"].join(curDir, 'jest.config.js'), _fs["default"].readFileSync(_path["default"].join(templateDir, 'package-template', 'jest.config.js')));
|
|
397
|
-
if (!_fs["default"].existsSync(_path["default"].join(srcDir, '__jest__'))) _fs["default"].mkdirSync(_path["default"].join(srcDir, '__jest__'));
|
|
398
|
-
if (!_fs["default"].existsSync(_path["default"].join(srcDir, '__jest__', 'remote.test.ts'))) _fs["default"].writeFileSync(_path["default"].join(srcDir, '__jest__', 'remote.test.ts'), _fs["default"].readFileSync(_path["default"].join(templateDir, 'package-template', 'src', '__jest__', 'remote.test.ts')));
|
|
399
|
-
if (!_fs["default"].existsSync(_path["default"].join(srcDir, '__jest__', 'test-node.ts'))) _fs["default"].writeFileSync(_path["default"].join(srcDir, '__jest__', 'test-node.ts'), _fs["default"].readFileSync(_path["default"].join(templateDir, 'package-template', 'src', '__jest__', 'test-node.ts')));
|
|
400
|
-
|
|
401
384
|
var packageTestPath = _path["default"].join(srcDir, 'package-test.ts');
|
|
402
385
|
|
|
403
386
|
if (!_fs["default"].existsSync(packageTestPath)) _fs["default"].writeFileSync(packageTestPath, _fs["default"].readFileSync(_path["default"].join(templateDir, 'package-template', 'src', 'package-test.ts')));
|
package/bin/commands/test.js
CHANGED
|
@@ -264,8 +264,10 @@ function test(args) {
|
|
|
264
264
|
if (r.failed) {
|
|
265
265
|
console.log(r.failReport);
|
|
266
266
|
color.fail('Tests failed.');
|
|
267
|
+
testUtils.exitWithCode(1);
|
|
267
268
|
} else {
|
|
268
269
|
color.success('Tests passed.');
|
|
270
|
+
testUtils.exitWithCode(0);
|
|
269
271
|
} //@ts-ignore
|
|
270
272
|
|
|
271
273
|
|
package/bin/utils/test-utils.js
CHANGED
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
10
|
exports.defaultLaunchParameters = void 0;
|
|
11
|
+
exports.exitWithCode = exitWithCode;
|
|
11
12
|
exports.getBrowserPage = getBrowserPage;
|
|
12
13
|
exports.getDevKey = getDevKey;
|
|
13
14
|
exports.getToken = getToken;
|
|
@@ -285,4 +286,9 @@ function runWithTimeout(timeout, f) {
|
|
|
285
286
|
return _ref.apply(this, arguments);
|
|
286
287
|
};
|
|
287
288
|
}());
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
function exitWithCode(code) {
|
|
292
|
+
console.log("Exiting with code ".concat(code));
|
|
293
|
+
process.exit(code);
|
|
288
294
|
}
|
package/package.json
CHANGED