simondotm / nx-firebase

Firebase plugin for Nx Monorepos
https://www.npmjs.com/package/@simondotm/nx-firebase
MIT License
175 stars 31 forks source link

Generate nx command for executing tests with emulators running #38

Closed Schmale97 closed 1 year ago

Schmale97 commented 3 years ago

Possible enhancement for nx command in the workspace.json that runs the test command within the firebase emulators:exec command - similar to below?

"testWithEmulatorsRunning": {
    "executor": "@nrwl/workspace:run-commands",
    "options": {
        "command": "nx functions-app:build --with-deps && firebase emulators:exec --project=test 'nx run functions-app:test' --config firebase.functions-app.json"
    }
}
adrian-marcelo-gallardo commented 2 years ago

@Schmale97 note there is a typo in the command, it should be nx run functions-app:build (run keyword is missing).

Just for complementing this, and as an alternative config, you can provide both commands (build and run) separate:

"testWithEmulatorsRunning": {
    "executor": "@nrwl/workspace:run-commands",
    "options": {
         "commands": [
              {
                "command": "nx run functions-app:build --with-deps"
              },
              {
                "command": "firebase emulators:exec --project=test 'nx run functions-app:test' --config firebase.functions-app.json"
              }
          ]
    }
}
simondotm commented 1 year ago

Closing due to v2 release and age of issue. Folks, feel free to modify and customise your project.json files to suit your workflows! 👍