GSI - Employe Self Service Mobile
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
2.7 KiB

2 months ago
  1. # @firebase/auth
  2. This is the Firebase Authentication component of the Firebase JS SDK.
  3. **This package is not intended for direct usage, and should only be used via the officially supported [firebase](https://www.npmjs.com/package/firebase) package.**
  4. ## Testing
  5. The modular Auth SDK has both unit tests and integration tests, along with a
  6. host of npm scripts to run these tests. The most important commands are:
  7. | Command | Description |
  8. | ------- | ----------- |
  9. | `yarn test` | This will run lint, unit tests, and integration tests against the live environment|
  10. | `yarn test:<platform>` | Runs all browser tests, unit and integration |
  11. | `yarn test:<platform>:unit` | Runs only \<platform> unit tests |
  12. | `yarn test:<platform>:unit:debug` | Runs \<platform> unit tests, auto-watching for file system changes |
  13. | `yarn test:<platform>:integration` | Runs only integration tests against the live environment |
  14. | `yarn test:<platform>:integration:local` | Runs all headless \<platform> integration tests against the emulator (more below) |
  15. Where \<platform> is "browser" or "node". There are also cordova tests, but they
  16. are not broken into such granular details. Check out `package.json` for more.
  17. ### Integration testing with the emulator
  18. To test against the emulator, set up the Auth emulator
  19. ([instructions](https://firebase.google.com/docs/emulator-suite/connect_and_prototype)).
  20. The easiest way to run these tests is to use the `firebase emulators:exec`
  21. command
  22. ([documentation](https://firebase.google.com/docs/emulator-suite/install_and_configure#startup)).
  23. You can also manually start the emulator separately, and then point the tests
  24. to it by setting the `GCLOUD_PROJECT` and `FIREBASE_AUTH_EMULATOR_HOST`
  25. environmental variables. In addition to the commands listed above, the below
  26. commands also run various tests:
  27. * `yarn test:integration:local` — Executes Node and browser emulator
  28. integration tests, as well as the Selenium WebDriver tests
  29. * `yarn test:webdriver` — Executes only the Selenium WebDriver
  30. integration tests
  31. For example, to run all integration and WebDriver tests against the emulator,
  32. you would simply execute the following command:
  33. ```sh
  34. firebase emulators:exec --project foo-bar --only auth "yarn test:integration:local"
  35. ```
  36. ### Selenium Webdriver tests
  37. These tests assume that you have both Firefox and Chrome installed on your
  38. computer and in your `$PATH`. The tests will error out if this is not the case.
  39. The WebDriver tests talk to the emulator, but unlike the headless integration
  40. tests, these run in a browser robot environment; the assertions themselves run
  41. in Node. When you run these tests a small Express server will be started to
  42. serve the static files the browser robot uses.