test-e2e.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /**
  2. * Config responsible for building End-to-End test files (bundled into `test/dist/`):
  3. * - e2e.entry.js
  4. * - helpers.entry.js
  5. */
  6. const path = require('path');
  7. const webpack = require('webpack');
  8. const configFactory = require('./base');
  9. const JasmineHtml = require('./plugin/jasmine-html');
  10. module.exports.create = function create(envArgs) {
  11. const config = configFactory.create(envArgs);
  12. config.forEach(function(c) {
  13. c.devtool = 'cheap-module-source-map';
  14. c.target = 'web';
  15. c.output = {
  16. libraryTarget: 'var',
  17. filename: '[name].entry.js',
  18. path: path.resolve(__dirname, '../test/dist'),
  19. };
  20. c.resolve.alias.handsontable = path.resolve(__dirname, '../src');
  21. c.module.rules.unshift({
  22. test: [
  23. // Disable loading css files from pikaday module
  24. /pikaday\/css/,
  25. ],
  26. loader: path.resolve(__dirname, 'loader/empty-loader.js'),
  27. });
  28. c.externals = [
  29. {
  30. window: 'window',
  31. },
  32. ];
  33. c.plugins.push(
  34. new JasmineHtml({
  35. filename: path.resolve(__dirname, '../test/E2ERunner.html'),
  36. baseJasminePath: '../',
  37. externalCssFiles: [
  38. 'lib/normalize.css',
  39. '../dist/handsontable.css',
  40. 'helpers/common.css',
  41. ],
  42. externalJsFiles: [
  43. 'helpers/jasmine-bridge-reporter.js',
  44. 'lib/jquery.min.js',
  45. 'lib/jquery.simulate.js',
  46. 'lib/lodash.underscore.js',
  47. 'lib/backbone.js',
  48. '../node_modules/numbro/dist/numbro.js',
  49. '../node_modules/numbro/dist/languages.min.js',
  50. '../dist/moment/moment.js',
  51. '../dist/pikaday/pikaday.js',
  52. '../dist/handsontable.js',
  53. '../dist/languages/all.js',
  54. ],
  55. })
  56. );
  57. c.node.global = true;
  58. });
  59. return [].concat(config);
  60. }