-
Notifications
You must be signed in to change notification settings - Fork 940
Add testing module #514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add testing module #514
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is amazing, thank you for figuring out how to implement this cleanly.
credential: new FakeCredentials(), | ||
databaseURL: DBURL + '?ns=' + options.databaseName | ||
}, | ||
'app-' + (new Date().getTime() + Math.random()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this Math.random()
is actually increasing the chance of a name collision. Can we just use the timestamp or an autoincrement id?
databaseURL: DBURL + '?ns=' + options.databaseName, | ||
databaseAuthVariableOverride: options.auth || null | ||
}, | ||
'app-' + (new Date().getTime() + Math.random()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe call this admin-app-{}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty good, a couple of things to address. Small things are in the comments.
I did notice, that you have the package-lock.json
file in this package. I'm a little worried about that as it means you used NPM
, instead of yarn
to install/manage dependencies.
If you could delete that, clean the git tree (git clean -xdf
) and then do a reinstall of your dependencies from the root using yarn
that'll give me some piece of mind. If there are any yarn.lock
changes from that, those will need to be committed.
@@ -0,0 +1,39 @@ | |||
{ | |||
"name": "@firebase/testing", | |||
"version": "0.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets make sure we have the private
value set to true
for this module. I don't think we want to publish this quite yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
packages/testing/package.json
Outdated
"module": "dist/esm/index.js", | ||
"scripts": { | ||
"dev": "gulp dev", | ||
"test": "run-p test:node", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't have any browser tests you can omit the npm-run-all
dependency, and replace this test
script with the one in test:node
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Currently, there is no line in the Want to add the team working on this as a line there? Something like:
|
The goal of this PR is to add a new module
@firebase/testing
that is a relatively stand alone module that can be included to test js apps locally.