Skip to main content

Manual User Testing

You can also test your application manually like usual. This is helpful to debug things that not available with automation yet, such as component runtime performance, and animation. This should be your last resort of debugging techniques, always try solving it with automated tests.

Testing production build

When running pnpm dev, you're debugging development build, which contains a lot of development check which makes your app slower. If you want to test production build you can follow these steps:

First, build your service locally. You can use pnpm --filter {packageName} build in root www

pnpm --filter @traveloka/webxpe-desktop build

Then re-run the service using start command instead of dev

pnpm start

This command will inject NODE_ENV=production environment variable to disable any dev-only checking and force your service to be run in production mode. Make sure you're already built your package before running this command

Runtime config

You can pass NODE_CONFIG_ENV environment variable to test different environment setting. Usually you do this when you want to test how your app works with different API servers. By default we're using development config, but there are 3 other values you can pick: production, staging, and test.

Pass that environment variable before starting dev proxy:

NODE_CONFIG_ENV=staging pnpm dev

Note that runtime config only reflects how specific values are resolved in runtime. You can combine both commands to test both production config and production build:

NODE_CONFIG_ENV=production pnpm start

Testing in Local Environment

As mentioned above, you can change which API servers you wanted to use to run your application. However when running the application using NODE_CONFIG_ENV=staging, some APIs won't work because those API endpoints can only be called in the staging environment via internal load balancers.

Therefore to run your application in local environment while calling staging API, you can use:

API_ENV=staging pnpm dev