alxndrsn commented on code in PR #9212:
URL: https://github.com/apache/pouchdb/pull/9212#discussion_r3004306267
##########
TESTING.md:
##########
@@ -5,14 +5,16 @@ run them. PouchDB has been primarily developed on Linux and
macOS, if you are
using Windows then these instructions will have problems, we would love your
help fixing them though.
-> [!WARNING] VERY IMPORTANT
-> **Always set the `COUCH_HOST` env var to a proper CouchDB for the
integration tests!**
+> [!WARNING]
+> VERY IMPORTANT **Always set the `COUCH_HOST` env var to a proper CouchDB for
+> the integration tests!**
Review Comment:
Are these changes related to the new tests?
##########
tests/multitab/user_agent.js:
##########
@@ -0,0 +1,53 @@
+'use strict';
+
+const playwright = require('playwright');
+
+const ADAPTERS = process.env.ADAPTERS || 'indexeddb';
+const CLIENT = process.env.CLIENT || 'firefox';
+const SHELL_URL = 'http://127.0.0.1:8000/tests/multitab/shell.html';
+
+class UserAgent {
+ static async start() {
+ let browser = await playwright[CLIENT].launch();
+ let context = await browser.newContext();
+ return new UserAgent(ADAPTERS, browser, context);
+ }
+
+ constructor(adapter, browser, context) {
+ this._adapter = adapter;
+ this._browser = browser;
+ this._context = context;
+ this._pages = new Map();
+ }
+
+ async stop() {
+ await this._browser.close();
+ }
+
+ async eval(pageId, fn) {
+ let page = await this._getPage(pageId);
+ return page.evaluate(fn);
+ }
+
+ _getPage(id) {
Review Comment:
"page" means "tab"? Maybe helpful to use consistent language?
##########
.eslintrc.json:
##########
@@ -21,7 +21,8 @@
"ArrayBuffer": "readonly",
"FileReaderSync": "readonly",
"emit": "readonly",
- "PouchDB": "readonly"
+ "PouchDB": "readonly",
+ "__pouch__": "readonly"
Review Comment:
Could `window.__pouch__` could be used instead of adding an extra constant
here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]