Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@datagrok/api-tests

Package Overview
Dependencies
Maintainers
6
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datagrok/api-tests - npm Package Compare versions

Comparing version 1.7.2 to 1.7.3

6

package.json
{
"name": "@datagrok/api-tests",
"friendlyName": "API Tests",
"version": "1.7.2",
"version": "1.7.3",
"author": {
"name": "Alexander Paramonov",
"email": "aparamonov@datagrok.ai"
"name": "Anna Muzychyna",
"email": "amuzychyna@datagrok.ai"
},

@@ -9,0 +9,0 @@ "description": "Automated tests for the [Datagrok JS API](https://datagrok.ai/js-api)",

import * as grok from 'datagrok-api/grok';
import * as DG from 'datagrok-api/dg';
import {category, test, expect} from '@datagrok-libraries/utils/src/test';
import {category, test, expect, expectTable} from '@datagrok-libraries/utils/src/test';

@@ -15,4 +15,4 @@ const GDF = grok.dapi.functions;

const clonedFunccall = funcCall.clone();
expect(funcCall.inputs['table'], clonedFunccall.inputs['table']);
expect(funcCall.outputs['tableOut'], clonedFunccall.outputs['tableOut']);
expectTable(funcCall.inputs['table'], clonedFunccall.inputs['table'].dataFrame);
expectTable(funcCall.outputs['tableOut'], clonedFunccall.outputs['tableOut'].dataFrame);
});

@@ -19,0 +19,0 @@

import {after, before, category, test, expect} from '@datagrok-libraries/utils/src/test';
import * as grok from 'datagrok-api/grok';
import * as ui from 'datagrok-api/ui';
// import * as ui from 'datagrok-api/ui';
import * as DG from 'datagrok-api/dg';

@@ -15,7 +15,7 @@

test('Dapi: groups - find group', async () => {
test('find group', async () => {
expect((await grok.dapi.groups.filter('unexisting group').first()) == undefined);
});
test('Dapi: groups - create group', async () => {
test('create group', async () => {
let localTestGroup = null as any;

@@ -30,3 +30,3 @@ try {

test('Dapi: groups - create subgroup', async () => {
test('create subgroup', async () => {
let subgroup = null as any;

@@ -42,3 +42,3 @@ try {

test('Dapi: groups - include member', async () => {
test('include member', async () => {
let subgroup = null as any;

@@ -65,3 +65,3 @@ let demoGroup = null as any;

if (!hasAdmin)
throw 'Member not added';
throw new Error('Member not added');
} finally {

@@ -73,3 +73,3 @@ await grok.dapi.groups.delete(demoGroup);

test('Dapi: groups - delete group', async () => {
test('delete group', async () => {
const localTestGroupName = 'js-api-test-group1';

@@ -76,0 +76,0 @@ const localTestGroup = await grok.dapi.groups.createNew(localTestGroupName);

@@ -303,3 +303,3 @@ import * as DG from 'datagrok-api/dg';

c.set(1, dayjs('2022-01-01'));
expect(c.get(1).valueOf(), 1641013200000);
expect(c.get(1).valueOf(), 1640988000000);
c.set(1, null);

@@ -306,0 +306,0 @@ expect(c.get(1), null);

@@ -22,14 +22,14 @@ /* eslint-disable max-len */

const testData = DG.DataFrame.fromCsv(`countries,fasta,smiles,molregno,LON,Zip Code,Street Address Line 1,ImageUrl,user_id,error_message,xray,flag,magnitude,CS-id,pdb_id,accel_a,time_offset,empty_number,empty_string
Belgium,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C(=O)OCCCc1cccnc1)c2cccc(c2)C(=O)c3ccccc3,1480014,36.276729583740234,995042300,14016 ROUTE 31W,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,1,1,1QBS,1,1.23,100,abc
Burundi,MDYKETLLMPKTDFPMRGGLPNKEPQIQEKW,COc1ccc2cc(ccc2c1)C(C)C(=O)Oc3ccc(C)cc3OC,1480015,36.276729583740234,995073444,80 STATE HIGHWAY 310,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,2,2,1ZP8,2,1.23,,
Cameroon,MIEVFLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL,COc1ccc2cc(ccc2c1)C(C)C(=O)OCCCc3cccnc3,1480016,36.26095962524414,995153596,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,3,3,2BDJ,3,1.23,,
Canada,MMELVLKTIIGPIVVGVVLRIVDKWLNKDK,CC(C(=O)NCCS)c1cccc(c1)C(=O)c2ccccc2,1480017,36.26095962524414,99515,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,4,4,1IAN,4,1.23,,
Colombia,MDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN,FC(F)(F)c1ccc(OC2CCNCC2)cc1,1480029,36.3309440612793,995152050,1 COURT HOUSE SQUARE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,5,5,4UJ1,5,1.23,,
Costa Rica,MKSTKEEIQTIKTLLKDSRTAKYHKRLQIVL,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCCc3ccccc3,1480018,36.3309440612793,995084218,4041 SOUTHWESTERN BLVD,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,6,6,2BPW,6,1.23,,
Cuba,MHAILRYFIRRLFYHIFYKIYSLISKKHQSLPSDVRQF,COc1ccc2c(c1)c(CC(=O)N3CCCC3C(=O)Oc4ccc(C)cc4OC)c(C)n2C(=O)c5ccc(Cl)cc5,1480019,36.33115768432617,995081928,1227 US HIGHWAY 11,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,7,7,1QBS,7,1.23,,
Italy,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO[N+](=O)[O-],1480020,36.33115768432617,99502,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,8,8,1ZP8,8,1.23,,
Rwanda,MPNSEPASLLELFNSIATQGELVRSLKAGNASK,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO,1480021,36.33137130737305,995037247,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,9,9,2BDJ,9,1.23,,
Switzerland,IRVVGRYLIEVWKAAGMDMDKVLFLWSSDEI,CN1CCC(CC1)Oc2ccc(cc2)C(F)(F)F,1480028,36.33137130737305,99504,92-11 179TH PLACE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,9,10,1IAN,10,1.23,,
,,,,,,,,,,,,,,,,,,`);
const testData = DG.DataFrame.fromCsv(`countries,fasta,smiles,molregno,LON,Zip Code,Street Address Line 1,ImageUrl,user_id,error_message,xray,flag,magnitude,CS-id,pdb_id,accel_a,time_offset,chart,fit,empty_number,empty_string
Belgium,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C(=O)OCCCc1cccnc1)c2cccc(c2)C(=O)c3ccccc3,1480014,36.276729583740234,995042300,14016 ROUTE 31W,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,1,1,1QBS,1,1.23,<chart></chart>,series points parameters fitLineColor pointColor showCurveConfidenceInterval,100,abc
Burundi,MDYKETLLMPKTDFPMRGGLPNKEPQIQEKW,COc1ccc2cc(ccc2c1)C(C)C(=O)Oc3ccc(C)cc3OC,1480015,36.276729583740234,995073444,80 STATE HIGHWAY 310,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,2,2,1ZP8,2,1.23,<chart></chart>,series points parameters fitLineColor pointColor showCurveConfidenceInterval,,
Cameroon,MIEVFLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL,COc1ccc2cc(ccc2c1)C(C)C(=O)OCCCc3cccnc3,1480016,36.26095962524414,995153596,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,3,3,2BDJ,3,1.23,<chart></chart>,series points parameters fitLineColor pointColor showCurveConfidenceInterval,,
Canada,MMELVLKTIIGPIVVGVVLRIVDKWLNKDK,CC(C(=O)NCCS)c1cccc(c1)C(=O)c2ccccc2,1480017,36.26095962524414,99515,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,4,4,1IAN,4,1.23,<chart></chart>,series points parameters fitLineColor pointColor showCurveConfidenceInterval,,
Colombia,MDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN,FC(F)(F)c1ccc(OC2CCNCC2)cc1,1480029,36.3309440612793,995152050,1 COURT HOUSE SQUARE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,5,5,4UJ1,5,1.23,<chart></chart>,series points parameters fitLineColor pointColor showCurveConfidenceInterval,,
Costa Rica,MKSTKEEIQTIKTLLKDSRTAKYHKRLQIVL,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCCc3ccccc3,1480018,36.3309440612793,995084218,4041 SOUTHWESTERN BLVD,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,6,6,2BPW,6,1.23,<chart></chart>,series points parameters fitLineColor pointColor showCurveConfidenceInterval,,
Cuba,MHAILRYFIRRLFYHIFYKIYSLISKKHQSLPSDVRQF,COc1ccc2c(c1)c(CC(=O)N3CCCC3C(=O)Oc4ccc(C)cc4OC)c(C)n2C(=O)c5ccc(Cl)cc5,1480019,36.33115768432617,995081928,1227 US HIGHWAY 11,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,7,7,1QBS,7,1.23,<chart></chart>,series points parameters fitLineColor pointColor showCurveConfidenceInterval,,
Italy,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO[N+](=O)[O-],1480020,36.33115768432617,99502,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,8,8,1ZP8,8,1.23,<chart></chart>,series points parameters fitLineColor pointColor showCurveConfidenceInterval,,
Rwanda,MPNSEPASLLELFNSIATQGELVRSLKAGNASK,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO,1480021,36.33137130737305,995037247,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,9,9,2BDJ,9,1.23,<chart></chart>,series points parameters fitLineColor pointColor showCurveConfidenceInterval,,
Switzerland,IRVVGRYLIEVWKAAGMDMDKVLFLWSSDEI,CN1CCC(CC1)Oc2ccc(cc2)C(F)(F)F,1480028,36.33137130737305,99504,92-11 179TH PLACE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,COMPND ATOM END,flag,9,10,1IAN,10,1.23,<chart></chart>,series points parameters fitLineColor pointColor showCurveConfidenceInterval,,
,,,,,,,,,,,,,,,,,,,,`);
testData.columns.add(DG.Column.fromList(DG.TYPE.BYTE_ARRAY, 'BinaryImage', Array.from(new Uint8Array(11))));

@@ -36,0 +36,0 @@

@@ -8,3 +8,3 @@ import * as grok from 'datagrok-api/grok';

const langs = ['Python', 'R', 'Octave', 'Grok', 'Julia', 'JavaScript']; // NodeJS
const langs = ['Python', 'R', 'Octave', 'Grok', 'Julia', 'JavaScript']; // NodeJS, Julia

@@ -30,3 +30,3 @@ for (const l of langs) {

if (call.getParamValue('rd') !== 39.9) throw new Error(`${call.getParamValue('rd')} != 39.9`);
});
}, {skipReason: l === 'Julia' ? 'GROK-12386' : undefined});
test('bool', async () => {

@@ -37,7 +37,7 @@ if (!call.getParamValue('rb')) throw new Error(`${call.getParamValue('rb')} != true`);

if (call.getParamValue('rs') !== 'abcabc') throw new Error(`"${call.getParamValue('rs')}" != "abcabc"`);
});
}, {skipReason: l === 'Julia' ? 'GROK-12386' : undefined});
test('datetime', async () => {
if (!checkDate(call.getParamValue('rdt')))
throw new Error(`${call.getParamValue('rdt')} != 1961-06-11`);
}, {skipReason: l === 'Octave' ? 'GROK-12417' : undefined});
}, {skipReason: ['Octave', 'Python', 'Julia'].includes(l) ? 'GROK-12417' : undefined});
test('map', async () => {

@@ -51,3 +51,3 @@ if (call.getParamValue('rm').b !== 5) throw new Error(`${call.getParamValue('rm').b} != 5`);

}
});
}, {skipReason: l === 'Julia' ? 'GROK-12386' : undefined});
});

@@ -59,3 +59,3 @@ }

if (dt instanceof Date) return dt.toDateString() === 'Sun Jun 11 1961';
return dt.format().includes('1961-06-11T00:00:00');
return dt.format().includes('1961-06-11T');
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc