Skip to content

Commit 812b389

Browse files
committed
Get e2e test working
1 parent 3e8f634 commit 812b389

File tree

3 files changed

+83
-67
lines changed

3 files changed

+83
-67
lines changed

e2e/sample-apps/modular.js

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -314,13 +314,20 @@ async function callVertexAI(app) {
314314
console.log('[VERTEXAI] start');
315315
const vertexAI = getVertexAI(app);
316316
const model = getGenerativeModel(vertexAI, {
317-
mode: 'prefer_in_cloud'
317+
mode: 'prefer_on_device'
318318
});
319-
const result = await model.generateContentStream("What is Roko's Basalisk?");
320-
for await (const chunk of result.stream) {
321-
console.log(chunk.text());
322-
}
323-
console.log(`[VERTEXAI] counted tokens: ${result.totalTokens}`);
319+
const prompt = "What is Roko's Basalisk?";
320+
const singleResult = await model.generateContent(prompt);
321+
console.log(`Generated text: ${singleResult.response.text()}`);
322+
// const streamResult = await model.generateContentStream(
323+
// prompt
324+
// );
325+
// for await (const chunk of streamResult.stream) {
326+
// console.log(chunk.text());
327+
// }
328+
// const countResult = await model.countTokens(prompt)
329+
// console.log(`Count: ${countResult.totalTokens}`);
330+
console.log(`[VERTEXAI] end`);
324331
}
325332

326333
/**
@@ -346,18 +353,18 @@ async function main() {
346353
const app = initializeApp(config);
347354
setLogLevel('warn');
348355

349-
callAppCheck(app);
350-
await authLogin(app);
351-
await callStorage(app);
352-
await callFirestore(app);
353-
await callDatabase(app);
354-
await callMessaging(app);
355-
callAnalytics(app);
356-
callPerformance(app);
357-
await callFunctions(app);
356+
// callAppCheck(app);
357+
// await authLogin(app);
358+
// await callStorage(app);
359+
// await callFirestore(app);
360+
// await callDatabase(app);
361+
// await callMessaging(app);
362+
// callAnalytics(app);
363+
// callPerformance(app);
364+
// await callFunctions(app);
358365
await callVertexAI(app);
359-
callDataConnect(app);
360-
await authLogout(app);
366+
// callDataConnect(app);
367+
// await authLogout(app);
361368
console.log('DONE');
362369
}
363370

e2e/webpack.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ module.exports = [
8888
stats: {
8989
colors: true
9090
},
91-
devtool: 'source-map',
91+
// Generates more granular source map to avoid collisions between
92+
// getGenerativeModel and getAnalytics.
93+
devtool: 'eval-source-map',
9294
devServer: {
9395
static: './build'
9496
}

e2e/yarn.lock

Lines changed: 56 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,10 +1946,26 @@
19461946
dependencies:
19471947
"@types/node" "*"
19481948

1949-
"@types/estree@^1.0.5":
1950-
version "1.0.6"
1951-
resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50"
1952-
integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==
1949+
"@types/eslint-scope@^3.7.7":
1950+
version "3.7.7"
1951+
resolved "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz#3108bd5f18b0cdb277c867b3dd449c9ed7079ac5"
1952+
integrity sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==
1953+
dependencies:
1954+
"@types/eslint" "*"
1955+
"@types/estree" "*"
1956+
1957+
"@types/eslint@*":
1958+
version "9.6.1"
1959+
resolved "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz#d5795ad732ce81715f27f75da913004a56751584"
1960+
integrity sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==
1961+
dependencies:
1962+
"@types/estree" "*"
1963+
"@types/json-schema" "*"
1964+
1965+
"@types/estree@*", "@types/estree@^1.0.6":
1966+
version "1.0.7"
1967+
resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz#4158d3105276773d5b7695cd4834b1722e4f37a8"
1968+
integrity sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==
19531969

19541970
"@types/express-serve-static-core@*", "@types/express-serve-static-core@^5.0.0":
19551971
version "5.0.1"
@@ -2051,7 +2067,7 @@
20512067
"@types/tough-cookie" "*"
20522068
parse5 "^7.0.0"
20532069

2054-
"@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9":
2070+
"@types/json-schema@*", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.9":
20552071
version "7.0.15"
20562072
resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841"
20572073
integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==
@@ -2150,7 +2166,7 @@
21502166
dependencies:
21512167
"@types/yargs-parser" "*"
21522168

2153-
"@webassemblyjs/[email protected]", "@webassemblyjs/ast@^1.12.1":
2169+
"@webassemblyjs/[email protected]", "@webassemblyjs/ast@^1.14.1":
21542170
version "1.14.1"
21552171
resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz#a9f6a07f2b03c95c8d38c4536a1fdfb521ff55b6"
21562172
integrity sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==
@@ -2216,7 +2232,7 @@
22162232
resolved "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz#917a20e93f71ad5602966c2d685ae0c6c21f60f1"
22172233
integrity sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==
22182234

2219-
"@webassemblyjs/wasm-edit@^1.12.1":
2235+
"@webassemblyjs/wasm-edit@^1.14.1":
22202236
version "1.14.1"
22212237
resolved "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz#ac6689f502219b59198ddec42dcd496b1004d597"
22222238
integrity sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==
@@ -2251,7 +2267,7 @@
22512267
"@webassemblyjs/wasm-gen" "1.14.1"
22522268
"@webassemblyjs/wasm-parser" "1.14.1"
22532269

2254-
"@webassemblyjs/[email protected]", "@webassemblyjs/wasm-parser@^1.12.1":
2270+
"@webassemblyjs/[email protected]", "@webassemblyjs/wasm-parser@^1.14.1":
22552271
version "1.14.1"
22562272
resolved "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz#b3e13f1893605ca78b52c68e54cf6a865f90b9fb"
22572273
integrity sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==
@@ -2317,11 +2333,6 @@ acorn-globals@^7.0.0:
23172333
acorn "^8.1.0"
23182334
acorn-walk "^8.0.2"
23192335

2320-
acorn-import-attributes@^1.9.5:
2321-
version "1.9.5"
2322-
resolved "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz#7eb1557b1ba05ef18b5ed0ec67591bfab04688ef"
2323-
integrity sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==
2324-
23252336
acorn-walk@^8.0.2, acorn-walk@^8.1.1:
23262337
version "8.3.4"
23272338
resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz#794dd169c3977edf4ba4ea47583587c5866236b7"
@@ -2334,7 +2345,12 @@ acorn@^8.1.0, acorn@^8.11.0, acorn@^8.4.1, acorn@^8.8.1:
23342345
resolved "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0"
23352346
integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==
23362347

2337-
acorn@^8.7.1, acorn@^8.8.2:
2348+
acorn@^8.14.0:
2349+
version "8.14.1"
2350+
resolved "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz#721d5dc10f7d5b5609a891773d47731796935dfb"
2351+
integrity sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==
2352+
2353+
acorn@^8.8.2:
23382354
version "8.13.0"
23392355
resolved "https://registry.npmjs.org/acorn/-/acorn-8.13.0.tgz#2a30d670818ad16ddd6a35d3842dacec9e5d7ca3"
23402356
integrity sha512-8zSiw54Oxrdym50NlZ9sUusyO1Z1ZchgRLWRaK6c86XJFClyCgFKetdowBg5bKxyp/u+CDBJG4Mpp0m3HLZl9w==
@@ -2365,7 +2381,7 @@ ajv-keywords@^5.1.0:
23652381
dependencies:
23662382
fast-deep-equal "^3.1.3"
23672383

2368-
ajv@^6.12.4, ajv@^6.12.5:
2384+
ajv@^6.12.4:
23692385
version "6.12.6"
23702386
resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4"
23712387
integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==
@@ -2602,16 +2618,6 @@ braces@^3.0.3, braces@~3.0.2:
26022618
dependencies:
26032619
fill-range "^7.1.1"
26042620

2605-
browserslist@^4.21.10, browserslist@^4.24.4:
2606-
version "4.24.4"
2607-
resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz#c6b2865a3f08bcb860a0e827389003b9fe686e4b"
2608-
integrity sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==
2609-
dependencies:
2610-
caniuse-lite "^1.0.30001688"
2611-
electron-to-chromium "^1.5.73"
2612-
node-releases "^2.0.19"
2613-
update-browserslist-db "^1.1.1"
2614-
26152621
browserslist@^4.24.0:
26162622
version "4.24.2"
26172623
resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580"
@@ -2622,6 +2628,16 @@ browserslist@^4.24.0:
26222628
node-releases "^2.0.18"
26232629
update-browserslist-db "^1.1.1"
26242630

2631+
browserslist@^4.24.4:
2632+
version "4.24.4"
2633+
resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz#c6b2865a3f08bcb860a0e827389003b9fe686e4b"
2634+
integrity sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==
2635+
dependencies:
2636+
caniuse-lite "^1.0.30001688"
2637+
electron-to-chromium "^1.5.73"
2638+
node-releases "^2.0.19"
2639+
update-browserslist-db "^1.1.1"
2640+
26252641
26262642
version "2.1.1"
26272643
resolved "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05"
@@ -4950,15 +4966,6 @@ schema-utils@^2.6.5:
49504966
ajv "^6.12.4"
49514967
ajv-keywords "^3.5.2"
49524968

4953-
schema-utils@^3.2.0:
4954-
version "3.3.0"
4955-
resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz#f50a88877c3c01652a15b622ae9e9795df7a60fe"
4956-
integrity sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==
4957-
dependencies:
4958-
"@types/json-schema" "^7.0.8"
4959-
ajv "^6.12.5"
4960-
ajv-keywords "^3.5.2"
4961-
49624969
schema-utils@^4.0.0, schema-utils@^4.2.0:
49634970
version "4.2.0"
49644971
resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz#70d7c93e153a273a805801882ebd3bff20d89c8b"
@@ -5279,7 +5286,7 @@ tapable@^2.1.1, tapable@^2.2.0:
52795286
resolved "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0"
52805287
integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==
52815288

5282-
terser-webpack-plugin@^5.3.10:
5289+
terser-webpack-plugin@^5.3.11:
52835290
version "5.3.14"
52845291
resolved "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.14.tgz#9031d48e57ab27567f02ace85c7d690db66c3e06"
52855292
integrity sha512-vkZjpUjb6OMS7dhV+tILUW6BhpDR7P2L/aQSAv+Uwk+m8KATX9EccViHTJR2qDtACKPIYndLGCyl3FMo+r2LMw==
@@ -5617,18 +5624,18 @@ webpack-sources@^3.2.3:
56175624
resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde"
56185625
integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==
56195626

5620-
webpack@5.94.0:
5621-
version "5.94.0"
5622-
resolved "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz#77a6089c716e7ab90c1c67574a28da518a20970f"
5623-
integrity sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==
5624-
dependencies:
5625-
"@types/estree" "^1.0.5"
5626-
"@webassemblyjs/ast" "^1.12.1"
5627-
"@webassemblyjs/wasm-edit" "^1.12.1"
5628-
"@webassemblyjs/wasm-parser" "^1.12.1"
5629-
acorn "^8.7.1"
5630-
acorn-import-attributes "^1.9.5"
5631-
browserslist "^4.21.10"
5627+
webpack@5.98.0:
5628+
version "5.98.0"
5629+
resolved "https://registry.npmjs.org/webpack/-/webpack-5.98.0.tgz#44ae19a8f2ba97537978246072fb89d10d1fbd17"
5630+
integrity sha512-UFynvx+gM44Gv9qFgj0acCQK2VE1CtdfwFdimkapco3hlPCJ/zeq73n2yVKimVbtm+TnApIugGhLJnkU6gjYXA==
5631+
dependencies:
5632+
"@types/eslint-scope" "^3.7.7"
5633+
"@types/estree" "^1.0.6"
5634+
"@webassemblyjs/ast" "^1.14.1"
5635+
"@webassemblyjs/wasm-edit" "^1.14.1"
5636+
"@webassemblyjs/wasm-parser" "^1.14.1"
5637+
acorn "^8.14.0"
5638+
browserslist "^4.24.0"
56325639
chrome-trace-event "^1.0.2"
56335640
enhanced-resolve "^5.17.1"
56345641
es-module-lexer "^1.2.1"
@@ -5640,9 +5647,9 @@ [email protected]:
56405647
loader-runner "^4.2.0"
56415648
mime-types "^2.1.27"
56425649
neo-async "^2.6.2"
5643-
schema-utils "^3.2.0"
5650+
schema-utils "^4.3.0"
56445651
tapable "^2.1.1"
5645-
terser-webpack-plugin "^5.3.10"
5652+
terser-webpack-plugin "^5.3.11"
56465653
watchpack "^2.4.1"
56475654
webpack-sources "^3.2.3"
56485655

0 commit comments

Comments
 (0)