Skip to content

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

Merged
merged 8 commits into from
Feb 16, 2018
Merged

Add testing module #514

merged 8 commits into from
Feb 16, 2018

Conversation

tonymeng
Copy link
Contributor

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.

Copy link
Contributor

@ryanpbrewster ryanpbrewster left a 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())
Copy link
Contributor

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())
Copy link
Contributor

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-{}?

Copy link
Contributor

@jshcrowthe jshcrowthe left a 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",
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

"module": "dist/esm/index.js",
"scripts": {
"dev": "gulp dev",
"test": "run-p test:node",
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@jshcrowthe
Copy link
Contributor

Currently, there is no line in the .github/CODEOWNERS file for this package, as such you'll always need someone above that scope to approve PRs.

Want to add the team working on this as a line there? Something like:

packages/testing  @tonymeng @ryanpbrewster # Others if there are more

@tonymeng tonymeng merged commit b6b4e2f into master Feb 16, 2018
@tonymeng tonymeng deleted the tm-testing-module branch February 16, 2018 21:58
@firebase firebase locked and limited conversation to collaborators Oct 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants