traceur.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import includes from "lodash/includes";
  2. import runner from "@babel/helper-transform-fixture-test-runner";
  3. runner(
  4. `${__dirname}/fixtures/traceur`,
  5. "traceur",
  6. {
  7. ignoreSuites: [
  8. // weird environmental issue make these hard to test
  9. "Modules",
  10. // uses the old async generator proposal
  11. "AsyncGenerators",
  12. ],
  13. ignoreTasks: [
  14. // Node 0.10 doesn't like these due to either V8 bugs or lack of core-js functionality
  15. "Symbol/Object",
  16. "Symbol/ObjectModel",
  17. "Symbol/GetOwnPropertySymbols",
  18. // TODO
  19. "Yield/GeneratorSend",
  20. "Yield/BreakForOf",
  21. "Yield/GeneratorThrow",
  22. "Yield/ObjectModel",
  23. "Yield/ReturnGenerator",
  24. // yield as an identifier
  25. "Yield/YieldIdentifier",
  26. "Syntax/StrictKeywords",
  27. "Syntax/IsValidSimpleAssignmentTarget",
  28. // TODO: core-js fails these
  29. "Collections/Map",
  30. "Collections/Set",
  31. "ArrayExtras/From",
  32. "ArrayExtras/FindIndex",
  33. "ArrayExtras/Find",
  34. "StringExtras/Includes",
  35. "StringExtras/EndsWith",
  36. // this tests pollutes Object.prototype which messes things up
  37. "StringExtras/StartsWith",
  38. // babel has no way to check these :( TODO: add to caveats
  39. "TemplateLiterals/TemplateObjectCaching.module",
  40. // babel does function/class name inference which these tests don't take into consideration
  41. "Classes/ClassNameBinding",
  42. "PropertyMethodAssignment/PropertyMethodAssignment",
  43. // TODO: investigate
  44. "Classes/ExtendStrange",
  45. "Math/fround.module",
  46. // these are the responsibility of core-js
  47. "Spread/Type",
  48. "Spread/NoIterator",
  49. "Destructuring/Rest",
  50. "Destructuring/Empty",
  51. // babel doesn't like non-closing comments :)
  52. "Syntax/NoNewLineHereEndOfFile",
  53. // TODO
  54. "Classes/PrototypeDescriptor",
  55. // Babel assumes that all code transformed is a module so this isn't necessary
  56. "Strict",
  57. "Syntax/UseStrictEscapeSequence",
  58. "Syntax/UseStrictLineContinuation",
  59. "ObjectInitializerShorthand/StrictKeyword",
  60. // experimental es7 - the spec hasn't been finalized yet
  61. // these both fail because of filters between blocks
  62. "ArrayComprehension/Simple",
  63. "GeneratorComprehension/Simple",
  64. // TODO
  65. "Syntax/StrictKeywordsInPattern",
  66. ],
  67. },
  68. {},
  69. function(opts, task) {
  70. if (includes(task.exec.loc, "module.js")) {
  71. opts.plugins.push("transform-modules-commonjs");
  72. } else {
  73. opts.sourceType = "script";
  74. }
  75. },
  76. );