Skip to content

Add test runner script #3419

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 6 commits into from
Jul 25, 2020
Merged

Add test runner script #3419

merged 6 commits into from
Jul 25, 2020

Conversation

schmidt-sebastian
Copy link
Contributor

@schmidt-sebastian schmidt-sebastian commented Jul 16, 2020

By popular demand this PR cleans up our package.json by adding a test runner script that makes it much easier to specify the arguments for the Node test runner.

All *.js files are generated.

@changeset-bot
Copy link

changeset-bot bot commented Jul 16, 2020

💥 No Changeset

Latest commit: a7991c7

Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂

If these changes should be published to npm, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jul 16, 2020

Binary Size Report

Affected SDKs

  • @firebase/firestore

    Type Base (8a631e2) Head (d0cf18c) Diff
    browser 245 kB 246 kB +144 B (+0.1%)
    esm2017 193 kB 193 kB -223 B (-0.1%)
    main 469 kB 469 kB +181 B (+0.0%)
    module 243 kB 243 kB +122 B (+0.1%)
    react-native 193 kB 193 kB -223 B (-0.1%)
  • @firebase/firestore/exp

    Type Base (8a631e2) Head (d0cf18c) Diff
    browser 187 kB 188 kB +85 B (+0.0%)
    main 511 kB 512 kB +1.09 kB (+0.2%)
    react-native 187 kB 188 kB +86 B (+0.0%)
  • @firebase/firestore/lite

    Type Base (8a631e2) Head (d0cf18c) Diff
    browser 68.0 kB 68.2 kB +222 B (+0.3%)
    main 497 kB 498 kB +991 B (+0.2%)
    react-native 68.1 kB 68.3 kB +217 B (+0.3%)
  • @firebase/firestore/memory

    Type Base (8a631e2) Head (d0cf18c) Diff
    browser 184 kB 184 kB +144 B (+0.1%)
    esm2017 145 kB 145 kB -191 B (-0.1%)
    main 344 kB 344 kB +181 B (+0.1%)
    module 182 kB 182 kB +122 B (+0.1%)
    react-native 145 kB 145 kB -191 B (-0.1%)
  • firebase

    Click to show 14 binary size changes.
    Type Base (8a631e2) Head (d0cf18c) Diff
    firebase-analytics.js 28.0 kB 28.0 kB -5 B (-0.0%)
    firebase-auth.js 174 kB 173 kB -228 B (-0.1%)
    firebase-database.js 187 kB 187 kB -549 B (-0.3%)
    firebase-firestore.js 283 kB 282 kB -1.07 kB (-0.4%)
    firebase-firestore.memory.js 224 kB 223 kB -774 B (-0.3%)
    firebase-functions.js 9.84 kB 9.84 kB -1 B (-0.0%)
    firebase-installations.js 19.2 kB 19.2 kB -4 B (-0.0%)
    firebase-messaging.js 39.2 kB 39.2 kB -2 B (-0.0%)
    firebase-performance-standalone.es2017.js 72.0 kB 72.0 kB -13 B (-0.0%)
    firebase-performance-standalone.js 47.4 kB 47.2 kB -191 B (-0.4%)
    firebase-performance.js 37.8 kB 37.6 kB -205 B (-0.5%)
    firebase-remote-config.js 37.0 kB 37.0 kB -4 B (-0.0%)
    firebase-storage.js 39.9 kB 39.8 kB -62 B (-0.2%)
    firebase.js 817 kB 815 kB -2.04 kB (-0.2%)

Test Logs

@schmidt-sebastian schmidt-sebastian changed the title WIP Add test runner script Add test runner script Jul 24, 2020
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var __assign =
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to mark this file as generated code? I started writing a whole bunch of comments on this and then only realized later that you hadn't written this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the build rule to run these through terser, which should make this more obvious.

const nyc = resolve(__dirname, '../../../node_modules/.bin/nyc');
const mocha = resolve(__dirname, '../../../node_modules/.bin/mocha');

const env: { [key: string]: string } = {
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems way over complicated. spawn defaults to using the current environment, so just changing the environment of this process prepares the environment for the child.

const env = process.env;
env.TS_NODE_CACHE = 'NO';
env.TS_NODE_COMPILER_OPTIONS = '{"module":"commonjs"}';

If that's not possible, it seems like it's worth a comment here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That works as is. Thanks for the simplification.

@wilhuff wilhuff assigned schmidt-sebastian and unassigned wilhuff Jul 24, 2020
Copy link
Contributor

@wilhuff wilhuff left a comment

Choose a reason for hiding this comment

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

LGTM

@schmidt-sebastian schmidt-sebastian merged commit 2dd560b into master Jul 25, 2020
@firebase firebase locked and limited conversation to collaborators Aug 25, 2020
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/testrunners branch November 9, 2020 22:38
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