index.ts 736 B

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