index.ts 777 B

12345678910111213141516171819202122232425262728
  1. import * as wp from '@cypress/webpack-preprocessor';
  2. module.exports = (
  3. on: Cypress.PluginEvents,
  4. config: Cypress.PluginConfigOptions,
  5. ): Cypress.PluginConfigOptions => {
  6. const options = {
  7. webpackOptions: {
  8. resolve: {
  9. extensions: ['.ts', '.tsx', '.js'],
  10. },
  11. module: {
  12. rules: [
  13. {
  14. test: /\.tsx?$/,
  15. loader: 'ts-loader',
  16. options: { happyPackMode: true, transpileOnly: true },
  17. },
  18. ],
  19. },
  20. },
  21. };
  22. on('file:preprocessor', wp(options));
  23. // `config` is the resolved Cypress config
  24. config.baseUrl = `${process.env.BRIDGE_BASE_ADDRESS || 'http://localhost:9000/'}`;
  25. config.env.BRIDGE_KUBEADMIN_PASSWORD = process.env.BRIDGE_KUBEADMIN_PASSWORD;
  26. return config;
  27. };