@datagrok/bio 1.0.0 → 1.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/jest.config.js ADDED
@@ -0,0 +1,33 @@
1
+ module.exports = {
2
+ 'roots': [
3
+ '<rootDir>/src',
4
+ ],
5
+ 'testMatch': [
6
+ '**/__jest__/**/*.test.+(ts|tsx)',
7
+ ],
8
+ moduleFileExtensions: [
9
+ 'ts',
10
+ 'js',
11
+ ],
12
+ 'transform': {
13
+ '^.+\\.(ts|tsx)$': 'ts-jest',
14
+ },
15
+ transformIgnorePatterns: ['^.+\\.js$'],
16
+ globals: {
17
+ 'ts-jest': {
18
+ 'tsconfig': {
19
+ 'target': 'es6',
20
+ 'module': 'es2020',
21
+ },
22
+ },
23
+ },
24
+ reporters: [
25
+ 'default',
26
+ [
27
+ './node_modules/jest-html-reporter',
28
+ {
29
+ 'includeConsoleLog': true,
30
+ },
31
+ ],
32
+ ],
33
+ };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@datagrok/bio",
3
3
  "beta": false,
4
4
  "friendlyName": "Bio",
5
- "version": "1.0.0",
5
+ "version": "1.0.3",
6
6
  "description": "Bio is a [package](https://datagrok.ai/help/develop/develop#packages) for the [Datagrok](https://datagrok.ai) platform",
7
7
  "repository": {
8
8
  "type": "git",
@@ -10,18 +10,24 @@
10
10
  "directory": "packages/Bio"
11
11
  },
12
12
  "dependencies": {
13
- "@datagrok-libraries/bio": "^1.0.0",
13
+ "@datagrok-libraries/bio": "^2.0.1",
14
+ "@datagrok-libraries/utils": "^0.4.2",
14
15
  "cash-dom": "latest",
15
- "datagrok-api": "^1.0.0",
16
+ "datagrok-api": "^1.1.5",
16
17
  "dayjs": "latest",
17
18
  "ts-loader": "^9.2.5",
18
19
  "typescript": "^4.4.2"
19
20
  },
20
21
  "devDependencies": {
22
+ "@types/jest": "^27.0.0",
21
23
  "@typescript-eslint/eslint-plugin": "latest",
22
24
  "@typescript-eslint/parser": "latest",
23
25
  "eslint": "latest",
24
26
  "eslint-config-google": "latest",
27
+ "jest": "^27.0.0",
28
+ "jest-html-reporter": "^3.5.0",
29
+ "puppeteer": "latest",
30
+ "ts-jest": "^27.0.0",
25
31
  "webpack": "latest",
26
32
  "webpack-cli": "latest"
27
33
  },
@@ -39,7 +45,9 @@
39
45
  "debug-sequences1-local": "grok publish local --rebuild",
40
46
  "release-sequences1-local": "grok publish local --rebuild --release",
41
47
  "lint": "eslint \"./src/**/*.ts\"",
42
- "lint-fix": "eslint \"./src/**/*.ts\" --fix"
48
+ "lint-fix": "eslint \"./src/**/*.ts\" --fix",
49
+ "test": "jest",
50
+ "test-local": "set HOST=localhost && jest"
43
51
  },
44
52
  "canEdit": [
45
53
  "Developers"
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @jest-environment jsdom
3
+ */
4
+
5
+ import * as utils from './test-node';
6
+ import puppeteer from 'puppeteer';
7
+
8
+ const P_START_TIMEOUT: number = 100000;
9
+ let browser: puppeteer.Browser;
10
+ let page: puppeteer.Page;
11
+
12
+ beforeAll(async () => {
13
+ const out = await utils.getBrowserPage(puppeteer);
14
+ browser = out.browser;
15
+ page = out.page;
16
+ }, P_START_TIMEOUT);
17
+
18
+ afterAll(async () => {
19
+ await browser.close();
20
+ });
21
+
22
+ it('TEST', async () => {
23
+ const targetPackage: string = process.env.TARGET_PACKAGE ?? 'Bio';
24
+ console.log(`Testing ${targetPackage} package`);
25
+
26
+ //console.log(require('root-require')('package.json').version);
27
+ const r = await page.evaluate((targetPackage): Promise<object> => {
28
+ return new Promise<object>((resolve, reject) => {
29
+ (<any>window).grok.functions.eval(targetPackage + ':test()').then((df: any) => {
30
+ const cStatus = df.columns.byName('success');
31
+ const cMessage = df.columns.byName('result');
32
+ const cCat = df.columns.byName('category');
33
+ const cName = df.columns.byName('name');
34
+ let failed = false;
35
+ let report = '';
36
+ for (let i = 0; i < df.rowCount; i++) {
37
+ if (!cStatus.get(i)) {
38
+ report += `${cCat.get(i)}.${cName.get(i)}: ${cMessage.get(i)}\n`;
39
+ failed = true;
40
+ }
41
+ }
42
+ resolve({report, failed});
43
+ }).catch((e: any) => reject(e));
44
+ });
45
+ }, targetPackage);
46
+ // @ts-ignore
47
+ console.log(r.report);
48
+ // @ts-ignore
49
+ expect(r.failed).toBe(false);
50
+ }, 100000);
51
+
52
+ // it('WebLogo.getAlphabetSimilarity', () => {
53
+ //
54
+ // });
@@ -0,0 +1,97 @@
1
+ import * as path from 'path';
2
+ import * as os from 'os';
3
+ import * as fs from 'fs';
4
+ // @ts-ignore
5
+ import * as yaml from 'js-yaml';
6
+
7
+ const fetch = require('node-fetch');
8
+
9
+ export async function getToken(url: string, key: string) {
10
+ const response = await fetch(`${url}/users/login/dev/${key}`, {method: 'POST'});
11
+ const json = await response.json();
12
+ if (json.isSuccess == true)
13
+ return json.token;
14
+ else
15
+ throw new Error('Unable to login to server. Check your dev key');
16
+ }
17
+
18
+ export async function getWebUrl(url: string, token: string) {
19
+ const response = await fetch(`${url}/admin/plugins/admin/settings`, {headers: {Authorization: token}});
20
+ const json = await response.json();
21
+ return json.settings.webRoot;
22
+ }
23
+
24
+ const grokDir = path.join(os.homedir(), '.grok');
25
+ const confPath = path.join(grokDir, 'config.yaml');
26
+
27
+ function mapURL(conf: Config): Indexable {
28
+ const urls: Indexable = {};
29
+ for (const server in conf.servers)
30
+ urls[conf['servers'][server]['url']] = conf['servers'][server];
31
+
32
+ return urls;
33
+ }
34
+
35
+ export function getDevKey(hostKey: string): { url: string, key: string } {
36
+ const config = yaml.load(fs.readFileSync(confPath, 'utf8')) as any;
37
+ let host = hostKey == '' ? config.default : hostKey;
38
+ host = host.trim();
39
+ const urls = mapURL(config);
40
+ let key = '';
41
+ let url = '';
42
+ try {
43
+ let url = new URL(host).href;
44
+ if (url.endsWith('/')) url = url.slice(0, -1);
45
+ if (url in urls) key = config['servers'][urls[url]]['key'];
46
+ } catch (error) {
47
+ if (config['servers'][host] == null)
48
+ throw new Error(`Unknown server alias. Please add it to ${confPath}`);
49
+ url = config['servers'][host]['url'];
50
+ key = config['servers'][host]['key'];
51
+ }
52
+ return {url, key};
53
+ }
54
+
55
+ export async function getBrowserPage(puppeteer: any): Promise<{ browser: any, page: any }> {
56
+ let url: string = process.env.HOST ?? '';
57
+ const cfg = getDevKey(url);
58
+ url = cfg.url;
59
+
60
+ const key = cfg.key;
61
+ const token = await getToken(url, key);
62
+ url = await getWebUrl(url, token);
63
+ console.log(`Using web root: ${url}`);
64
+
65
+ const browser = await puppeteer.launch({
66
+ args: ['--disable-dev-shm-usage', '--disable-features=site-per-process'],
67
+ ignoreHTTPSErrors: true,
68
+ });
69
+
70
+ const page = await browser.newPage();
71
+ await page.goto(`${url}/oauth/`);
72
+ await page.setCookie({name: 'auth', value: token});
73
+ await page.evaluate((token: any) => {
74
+ window.localStorage.setItem('auth', token);
75
+ }, token);
76
+ await page.goto(url);
77
+ try {
78
+ await page.waitForSelector('.grok-preloader');
79
+ await page.waitForFunction(() => document.querySelector('.grok-preloader') == null, {timeout: 100000});
80
+ } catch (error) {
81
+ throw error;
82
+ }
83
+ return {browser, page};
84
+ }
85
+
86
+
87
+ interface Config {
88
+ servers: {
89
+ [alias: string]: {
90
+ url: string,
91
+ key: string
92
+ }
93
+ },
94
+ default: string,
95
+ }
96
+
97
+ interface Indexable {[key: string]: any;}
@@ -0,0 +1,18 @@
1
+ import * as DG from 'datagrok-api/dg';
2
+
3
+ import {runTests, tests} from '@datagrok-libraries/utils/src/test';
4
+
5
+ import './tests/WebLogo.test';
6
+
7
+ export const _packageTest = new DG.Package();
8
+ export {tests};
9
+
10
+ //name: test
11
+ //input: string category {optional: true}
12
+ //input: string t {optional: true}
13
+ //output: dataframe result
14
+ //top-menu: Tools | Dev | JS API Tests
15
+ export async function test(category: string, t: string): Promise<DG.DataFrame> {
16
+ const data = await runTests({category, test: t});
17
+ return DG.DataFrame.fromObjects(data)!;
18
+ }
@@ -0,0 +1,12 @@
1
+ import {after, before, category, test, expect, expectObject} from '@datagrok-libraries/utils/src/test';
2
+
3
+ import * as grok from 'datagrok-api/grok';
4
+ import * as ui from 'datagrok-api/ui';
5
+ import * as DG from 'datagrok-api/dg';
6
+
7
+ import {_testPaletteN, _testPaletteAA} from '@datagrok-libraries/bio/src/tests/palettes.test';
8
+
9
+ category('Palettes', () => {
10
+ test('testPaletteN', async () => { _testPaletteN(); });
11
+ test('testPaletteAA', async () => { _testPaletteAA(); });
12
+ });
@@ -0,0 +1,132 @@
1
+ import {after, before, category, test, expect, expectObject} from '@datagrok-libraries/utils/src/test';
2
+
3
+ import * as grok from 'datagrok-api/grok';
4
+ import * as ui from 'datagrok-api/ui';
5
+ import * as DG from 'datagrok-api/dg';
6
+
7
+ import {Nucleotides, NucleotidesPalettes} from '@datagrok-libraries/bio/src/nucleotides';
8
+ import {Aminoacids, AminoacidsPalettes} from '@datagrok-libraries/bio/src/aminoacids';
9
+ import {WebLogo} from '@datagrok-libraries/bio/src/viewers/web-logo';
10
+ import {SeqPalette} from '@datagrok-libraries/bio/src/seq-palettes';
11
+ import {UnknownSeqPalette} from '@datagrok-libraries/bio/src/unknown';
12
+
13
+ category('WebLogo', () => {
14
+ test('testGetAlphabetSimilarity', async () => { _testGetAlphabetSimilarity(); });
15
+
16
+ test('testPickupPaletteN1', async () => { _testPickupPaletteN1(); });
17
+ test('testPickupPaletteAA1', async () => { _testPickupPaletteAA1(); });
18
+
19
+ // dfAA2 is too similar to nucleotides
20
+ // test('testPickupPaletteAA2', async () => {
21
+ // _testPickupPaletteAA2();
22
+ // });
23
+ });
24
+
25
+ const dfN1: DG.DataFrame = DG.DataFrame.fromCsv(
26
+ `seq
27
+ 'ACGT'
28
+ 'CAGT'
29
+ 'TTCA'
30
+ `);
31
+
32
+ /** 2 - is an error monomer
33
+ * This sequence set should be classified as nucleotides sequences.
34
+ * Small error, not similar to amino acids.
35
+ */
36
+ const dfN1e: DG.DataFrame = DG.DataFrame.fromCsv(
37
+ `seq
38
+ ACGT
39
+ CAGT
40
+ TTC2
41
+ `);
42
+
43
+ /** Pure amino acids sequence */
44
+ const dfAA1: DG.DataFrame = DG.DataFrame.fromCsv(
45
+ `seq
46
+ FWPHWYV
47
+ YNRQWYV
48
+ MKPSWYV
49
+ `);
50
+
51
+ /** A - alanine, G - glycine, T -= threonine, C - cysteine, W - tryptophan
52
+ * This sequence set should be detected as amino acids more than nucleotides.
53
+ */
54
+ const dfAA2: DG.DataFrame = DG.DataFrame.fromCsv(
55
+ `seq
56
+ AGTC
57
+ AGTC
58
+ AGTCW
59
+ `);
60
+
61
+ /** This sequence set should be recognized as unknown. */
62
+ const dfX: DG.DataFrame = DG.DataFrame.fromCsv(
63
+ `seq
64
+ XZJ{}2
65
+ 5Z4733
66
+ 3Z6></
67
+ 675687
68
+ `);
69
+
70
+ export function _testGetAlphabetFreqs() {
71
+ const seqCol: DG.Column = dfN1.col('seq')!;
72
+ const mFreq = WebLogo.getAlphabetFreqs(seqCol);
73
+
74
+ expectObject(mFreq, {
75
+ 'A': 3,
76
+ 'C': 3,
77
+ 'G': 2,
78
+ 'T': 4
79
+ });
80
+ }
81
+
82
+ export function _testGetAlphabetSimilarity() {
83
+ const freq: { [m: string]: number } = {
84
+ 'A': 2041,
85
+ 'C': 3015,
86
+ 'G': 3015,
87
+ 'T': 2048,
88
+ '-': 1000
89
+ };
90
+ const alphabet: Set<string> = new Set(Object.keys(Nucleotides.Names));
91
+ const res = WebLogo.getAlphabetSimilarity(freq, alphabet);
92
+
93
+ expect(res > 0.6, true);
94
+ }
95
+
96
+ export function _testPickupPaletteN1() {
97
+ const seqCol: DG.Column = dfN1.col('seq')!;
98
+ const cp = WebLogo.pickUpPalette(seqCol);
99
+
100
+ expect(cp instanceof NucleotidesPalettes, true);
101
+ }
102
+
103
+ export function _testPickupPaletteAA1() {
104
+ const seqCol: DG.Column = dfAA1.col('seq')!;
105
+ const cp = WebLogo.pickUpPalette(seqCol);
106
+
107
+ expect(cp instanceof AminoacidsPalettes, true);
108
+ }
109
+
110
+ export function _testPickupPaletteAA2() {
111
+ const seqCol: DG.Column = dfAA2.col('seq')!;
112
+ const cp = WebLogo.pickUpPalette(seqCol);
113
+
114
+ expect(cp instanceof AminoacidsPalettes, true);
115
+ }
116
+
117
+ export function _testPickupPaletteAll() {
118
+ const seqColN1: DG.Column = dfN1.col('seq')!;
119
+ const seqColAA1: DG.Column = dfAA1.col('seq')!;
120
+ const seqColAA2: DG.Column = dfAA2.col('seq')!;
121
+ const seqColX: DG.Column = dfX.col('seq')!;
122
+
123
+ const cpN1: SeqPalette = WebLogo.pickUpPalette(seqColN1);
124
+ const cpAA1: SeqPalette = WebLogo.pickUpPalette(seqColAA1);
125
+ const cpAA2: SeqPalette = WebLogo.pickUpPalette(seqColAA2);
126
+ const cpX: SeqPalette = WebLogo.pickUpPalette(seqColX);
127
+
128
+ expect(cpN1 instanceof NucleotidesPalettes, true);
129
+ expect(cpAA1 instanceof AminoacidsPalettes, true);
130
+ expect(cpAA2 instanceof AminoacidsPalettes, true);
131
+ expect(cpX instanceof UnknownSeqPalette, true);
132
+ }
@@ -0,0 +1,245 @@
1
+ <html><head><meta charset="utf-8"/><title>Bio Test Report. Datagrok version datagrok/datagrok:latest SHA=e702a345ac13. Commit fb65a774.</title><style type="text/css">html,
2
+ body {
3
+ font-family: Arial, Helvetica, sans-serif;
4
+ font-size: 1rem;
5
+ margin: 0;
6
+ padding: 0;
7
+ color: #333;
8
+ }
9
+ body {
10
+ padding: 2rem 1rem;
11
+ font-size: 0.85rem;
12
+ }
13
+ #jesthtml-content {
14
+ margin: 0 auto;
15
+ max-width: 70rem;
16
+ }
17
+ header {
18
+ display: flex;
19
+ align-items: center;
20
+ }
21
+ #title {
22
+ margin: 0;
23
+ flex-grow: 1;
24
+ }
25
+ #logo {
26
+ height: 4rem;
27
+ }
28
+ #timestamp {
29
+ color: #777;
30
+ margin-top: 0.5rem;
31
+ }
32
+
33
+ /** SUMMARY */
34
+ #summary {
35
+ color: #333;
36
+ margin: 2rem 0;
37
+ display: flex;
38
+ font-family: monospace;
39
+ font-size: 1rem;
40
+ }
41
+ #summary > div {
42
+ margin-right: 2rem;
43
+ background: #eee;
44
+ padding: 1rem;
45
+ min-width: 15rem;
46
+ }
47
+ #summary > div:last-child {
48
+ margin-right: 0;
49
+ }
50
+ @media only screen and (max-width: 720px) {
51
+ #summary {
52
+ flex-direction: column;
53
+ }
54
+ #summary > div {
55
+ margin-right: 0;
56
+ margin-top: 2rem;
57
+ }
58
+ #summary > div:first-child {
59
+ margin-top: 0;
60
+ }
61
+ }
62
+
63
+ .summary-total {
64
+ font-weight: bold;
65
+ margin-bottom: 0.5rem;
66
+ }
67
+ .summary-passed {
68
+ color: #4f8a10;
69
+ border-left: 0.4rem solid #4f8a10;
70
+ padding-left: 0.5rem;
71
+ }
72
+ .summary-failed,
73
+ .summary-obsolete-snapshots {
74
+ color: #d8000c;
75
+ border-left: 0.4rem solid #d8000c;
76
+ padding-left: 0.5rem;
77
+ }
78
+ .summary-pending {
79
+ color: #9f6000;
80
+ border-left: 0.4rem solid #9f6000;
81
+ padding-left: 0.5rem;
82
+ }
83
+ .summary-empty {
84
+ color: #999;
85
+ border-left: 0.4rem solid #999;
86
+ }
87
+
88
+ .test-result {
89
+ padding: 1rem;
90
+ margin-bottom: 0.25rem;
91
+ }
92
+ .test-result:last-child {
93
+ border: 0;
94
+ }
95
+ .test-result.passed {
96
+ background-color: #dff2bf;
97
+ color: #4f8a10;
98
+ }
99
+ .test-result.failed {
100
+ background-color: #ffbaba;
101
+ color: #d8000c;
102
+ }
103
+ .test-result.pending {
104
+ background-color: #ffdf61;
105
+ color: #9f6000;
106
+ }
107
+
108
+ .test-info {
109
+ display: flex;
110
+ justify-content: space-between;
111
+ }
112
+ .test-suitename {
113
+ width: 20%;
114
+ text-align: left;
115
+ font-weight: bold;
116
+ word-break: break-word;
117
+ }
118
+ .test-title {
119
+ width: 40%;
120
+ text-align: left;
121
+ font-style: italic;
122
+ }
123
+ .test-status {
124
+ width: 20%;
125
+ text-align: right;
126
+ }
127
+ .test-duration {
128
+ width: 10%;
129
+ text-align: right;
130
+ font-size: 0.75rem;
131
+ }
132
+
133
+ .failureMessages {
134
+ padding: 0 1rem;
135
+ margin-top: 1rem;
136
+ border-top: 1px dashed #d8000c;
137
+ }
138
+ .failureMessages.suiteFailure {
139
+ border-top: none;
140
+ }
141
+ .failureMsg {
142
+ white-space: pre-wrap;
143
+ white-space: -moz-pre-wrap;
144
+ white-space: -pre-wrap;
145
+ white-space: -o-pre-wrap;
146
+ word-wrap: break-word;
147
+ }
148
+
149
+ .suite-container {
150
+ margin-bottom: 2rem;
151
+ }
152
+ .suite-info {
153
+ padding: 1rem;
154
+ background-color: #eee;
155
+ color: #777;
156
+ display: flex;
157
+ align-items: center;
158
+ margin-bottom: 0.25rem;
159
+ }
160
+ .suite-info .suite-path {
161
+ word-break: break-all;
162
+ flex-grow: 1;
163
+ font-family: monospace;
164
+ font-size: 1rem;
165
+ }
166
+ .suite-info .suite-time {
167
+ margin-left: 0.5rem;
168
+ padding: 0.2rem 0.3rem;
169
+ font-size: 0.75rem;
170
+ }
171
+ .suite-info .suite-time.warn {
172
+ background-color: #d8000c;
173
+ color: #fff;
174
+ }
175
+
176
+ /* CONSOLE LOGS */
177
+ .suite-consolelog {
178
+ margin-bottom: 0.25rem;
179
+ padding: 1rem;
180
+ background-color: #efefef;
181
+ }
182
+ .suite-consolelog-header {
183
+ font-weight: bold;
184
+ }
185
+ .suite-consolelog-item {
186
+ padding: 0.5rem;
187
+ }
188
+ .suite-consolelog-item pre {
189
+ margin: 0.5rem 0;
190
+ white-space: pre-wrap;
191
+ white-space: -moz-pre-wrap;
192
+ white-space: -pre-wrap;
193
+ white-space: -o-pre-wrap;
194
+ word-wrap: break-word;
195
+ }
196
+ .suite-consolelog-item-origin {
197
+ color: #777;
198
+ font-weight: bold;
199
+ }
200
+ .suite-consolelog-item-message {
201
+ color: #000;
202
+ font-size: 1rem;
203
+ padding: 0 0.5rem;
204
+ }
205
+
206
+ /* OBSOLETE SNAPSHOTS */
207
+ .suite-obsolete-snapshots {
208
+ margin-bottom: 0.25rem;
209
+ padding: 1rem;
210
+ background-color: #ffbaba;
211
+ color: #d8000c;
212
+ }
213
+ .suite-obsolete-snapshots-header {
214
+ font-weight: bold;
215
+ }
216
+ .suite-obsolete-snapshots-item {
217
+ padding: 0.5rem;
218
+ }
219
+ .suite-obsolete-snapshots-item pre {
220
+ margin: 0.5rem 0;
221
+ white-space: pre-wrap;
222
+ white-space: -moz-pre-wrap;
223
+ white-space: -pre-wrap;
224
+ white-space: -o-pre-wrap;
225
+ word-wrap: break-word;
226
+ }
227
+ .suite-obsolete-snapshots-item-message {
228
+ color: #000;
229
+ font-size: 1rem;
230
+ padding: 0 0.5rem;
231
+ }
232
+ </style></head><body><div id="jesthtml-content"><header><h1 id="title">Bio Test Report. Datagrok version datagrok/datagrok:latest SHA=e702a345ac13. Commit fb65a774.</h1></header><div id="metadata-container"><div id="timestamp">Started: 2022-06-06 08:15:45</div><div id="summary"><div id="suite-summary"><div class="summary-total">Suites (1)</div><div class="summary-passed">1 passed</div><div class="summary-failed summary-empty">0 failed</div><div class="summary-pending summary-empty">0 pending</div></div><div id="test-summary"><div class="summary-total">Tests (1)</div><div class="summary-passed">1 passed</div><div class="summary-failed summary-empty">0 failed</div><div class="summary-pending summary-empty">0 pending</div></div></div></div><div id="suite-1" class="suite-container"><div class="suite-info"><div class="suite-path">/home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts</div><div class="suite-time warn">18.503s</div></div><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename"> </div><div class="test-title">TEST</div><div class="test-status">passed</div><div class="test-duration">6.9s</div></div></div></div><div class="suite-consolelog"><div class="suite-consolelog-header">Console Log</div><div class="suite-consolelog-item"><pre class="suite-consolelog-item-origin"> at Object.&lt;anonymous&gt; (/home/runner/work/public/public/packages/Bio/src/__jest__/test-node.ts:63:11)
233
+ at Generator.next (&lt;anonymous&gt;)
234
+ at fulfilled (/home/runner/work/public/public/packages/Bio/src/__jest__/test-node.ts:28:58)
235
+ at processTicksAndRejections (internal/process/task_queues.js:97:5)</pre><pre class="suite-consolelog-item-message">Using web root: http://localhost:8080</pre></div><div class="suite-consolelog-item"><pre class="suite-consolelog-item-origin"> at /home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:24:11
236
+ at Generator.next (&lt;anonymous&gt;)
237
+ at /home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:34:71
238
+ at new Promise (&lt;anonymous&gt;)
239
+ at Object.&lt;anonymous&gt;.__awaiter (/home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:30:12)
240
+ at Object.&lt;anonymous&gt; (/home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:22:23)
241
+ at Promise.then.completed (/home/runner/work/public/public/packages/Bio/node_modules/jest-circus/build/utils.js:391:28)
242
+ at new Promise (&lt;anonymous&gt;)</pre><pre class="suite-consolelog-item-message">Testing Bio package</pre></div><div class="suite-consolelog-item"><pre class="suite-consolelog-item-origin"> at /home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:47:11
243
+ at Generator.next (&lt;anonymous&gt;)
244
+ at fulfilled (/home/runner/work/public/public/packages/Bio/src/__jest__/remote.test.ts:31:58)
245
+ at processTicksAndRejections (internal/process/task_queues.js:97:5)</pre><pre class="suite-consolelog-item-message"/></div></div></div></div></body></html>
package/webpack.config.js CHANGED
@@ -1,9 +1,15 @@
1
1
  const path = require('path');
2
+ const packageName = path.parse(require('./package.json').name).name.toLowerCase().replace(/-/g, '');
2
3
 
3
4
  module.exports = {
4
5
  mode: 'development',
5
6
  entry: {
6
- package: './src/package.ts',
7
+ package: ['./src/package.ts'],
8
+ test: {
9
+ filename: 'package-test.js',
10
+ library: {type: 'var', name: `${packageName}_test`},
11
+ import: './src/package-test.ts',
12
+ },
7
13
  },
8
14
  resolve: {
9
15
  fallback: {'url': false},