Automated tests using IndexedDB in a create-react-app - automated-tests

I'm re-implementing an old web app using create-react-app. The app is based around IndexedDB. create-react-app runs tests in Node.js, which does not have IndexedDB, so tests which access the DB will fail.
Should I eject and run tests in headless Chrome, or is there another approach?

fake-indexeddb implements almost all of the IndexedDB API in memory, so it can be used with Node.js
(To import it using ES modules, use import auto from "fake-indexeddb/auto.js";)

Related

Need to use the "Google-cloud-ndb" library in Python 2.7 version

We are currently using the Python 2.7 and Google App Engine NDB client.
Planning to migration from Google App Engine to Google Cloud NDB
As per docs, "google-cloud-ndb" library officially supports for Python 2.7 and Python 3.x as well.
So, we are trying to access the datastore through google-cloud-ndb.
We are facing the below trace which is related to DisturbutionNotFound Error
raise DistributionNotFound(req, requirers) DistributionNotFound: The 'google-cloud-ndb' distribution was not found and is required by the application
In Google App Engine, Python 2.7 doesn't support the use of requirements.txt file. This means you have to install all the modules/libraries you need for your App and deploy it together with your App to production. In your specific case, it means you have to install google-cloud-ndblibrary.
Follow the instructions here to install the libraries you need to run your App

React Native and using npm modules

So this is the case: we developed a web application. Now we are developing an app in React Native with Firebase, for iOS and Android... Is there a way to make use of the npm private module that we developed for the web application? Do we need to initialise firebase/app as well in typescript? Or is it really needed to develop a seperate module for android and a separate module for iOS?
So in this npm private module there are standardized ways for our company to get and set data in firestore.
Regards, Peter
As far as I understand it, every package from npm is mapped or linked to one in the respective operating system, that is Android and iOS in your case.
Is there a way to make use of the npm private module that we developed
for the web application?
Or is it really needed to develop a seperate module for android and a
separate module for iOS?
When there is no respective implementation for the operating system, that "translates" your npm package, it will not work.
Do we need to initialise firebase/app as well in typescript?
Yes indeed, also in react native you need to initialise firebase app.
So in this npm private module there are standardised ways for our
company to get and set data in firestore.
I cannot say why you did this in a custom way, if you use the "normal" firestore methods then maybe there is still a way to reuse some code? But that is hard to say from the outside.

Issues embedding Firebase inside other framework

We have our own swift framework REFFramework that is using carthage to import Firebase (analytics and firestore). This is the cartfile in REFFramework:
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseFirestoreBinary.json"
The REFFramework is used in the app also using carthage to import it.
In addition the app itself also imports other modules from firebase (remote config).
This is the cartfile of the app:
git ".../REFFramework"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseFirestoreBinary.json"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseRemoteConfigBinary.json"
As far as I know carthage is designed to fully support this kind of structure. We use other frameworks also embedded in REFFramework like this such as Alamofire.
However we notice a crash in the app that does not happen when we remove the Firebase out of the REFFramework.
So it's clearly todo with the embedding of Firebase in an intermediate Framework.
The crash is happening in "0 __pthread_kill", here is a screenshot of the debugger in xCode 10.3:
I see a remark in the documentation:
Note that the Firebase frameworks in the distribution include static libraries. While it is fine to link these into apps, it will generally not work to depend on them from wrapper dynamic frameworks.
Not sure if this is releated to this issue?
Yep, the Firebase Carthage frameworks include static libraries and can only be linked to other static library frameworks.

Polymer CLI and Firebase: what is the best build model?

Polymer CLI comes with several build options, including preset like es5-bundled.
I want to run my app on Firebase and have it compatible with older browser like IE11.
Are there specific build options that I should use?
I am using gulp after watching a video from the Google Polycast series
Building Firebase for production -- Polycasts #60
But the basic Polymer build should work as well without extra build options.

Meteor integration with node-ffi on client-side

Can I use Meteor with node-ffi (https://github.com/node-ffi/node-ffi) on client-side to allow users to load a native shared library on browser, making the browser capable of running the library and return the result to the server?
In practice: the user access the site from browser, click somewere, loads the library library path, them the library is executed and returns the result to server.
I'm pretty sure this won't work. The browser won't support what you are doing, as its a server wrapper, and will build an architecture specific wrapper to run the c++ code.

Resources