Advertisement
Guest User

Untitled

a guest
May 26th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. 'use strict'
  2. let wallabify = require('wallabify')
  3. let babelify = require('babelify')
  4. let babel = require('babel')
  5. let es6ToEs5Preprocessor = file => babel
  6. .transform(file.content, {sourceMap: true, filename: file.path, stage: 2})
  7.  
  8. let wallabyPostProcessor = wallabify({
  9. entryPatterns: ['./src/**/*.spec.js']
  10. },
  11. function (b) {
  12. b.transform(babelify, {
  13. extensions: ['.jsx', '.js']
  14. })
  15. })
  16.  
  17. module.exports = function (wallaby) {
  18. return {
  19. files: [
  20. {pattern: 'node_modules/babel-polyfill/dist/polyfill.js', instrument: false},
  21. {pattern: 'src/utils/karma.polyfill.js', instrument: false},
  22. {pattern: 'src/**/*.js', load: false},
  23. {pattern: 'src/**/*.jsx', load: false},
  24. {pattern: 'src/**/*.json', instrument: false},
  25. {pattern: 'src/**/*.spec.js', ignore: true}
  26. ],
  27.  
  28. tests: [
  29. {pattern: './src/**/*.spec.js', load: false}
  30. ],
  31.  
  32. postprocessor: wallabyPostProcessor,
  33.  
  34. testFramework: 'jasmine',
  35.  
  36. setup: function () {
  37. // required to trigger tests loading
  38. window.__moduleBundler.loadTests()
  39. },
  40.  
  41. preprocessors: {
  42. 'src/**/*.js': es6ToEs5Preprocessor,
  43. 'src/**/*.spec.js': es6ToEs5Preprocessor,
  44. 'src/**/*.jsx': es6ToEs5Preprocessor
  45. },
  46.  
  47. compilers: {
  48. 'src/**/*.js': wallaby.compilers.babel({
  49. stage: 2
  50. }),
  51. 'src/**/*.spec.js': wallaby.compilers.babel({
  52. stage: 2
  53. }),
  54. 'src/**/*.jsx': wallaby.compilers.babel({
  55. stage: 2
  56. })
  57. },
  58.  
  59. debug: true
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement