run_test262.js 645 B

123456789101112131415161718192021
  1. const fs = require("fs")
  2. const path = require("path")
  3. const run = require("test262-parser-runner")
  4. const parse = require("..").parse
  5. const unsupportedFeatures = [
  6. "BigInt",
  7. "class-fields",
  8. "class-fields-private",
  9. "class-fields-public",
  10. "numeric-separator-literal"
  11. ];
  12. run(
  13. (content, {sourceType}) => parse(content, {sourceType, ecmaVersion: 10}),
  14. {
  15. testsDirectory: path.dirname(require.resolve("test262/package.json")),
  16. skip: test => (test.attrs.features && unsupportedFeatures.some(f => test.attrs.features.includes(f))),
  17. whitelist: fs.readFileSync("./bin/test262.whitelist", "utf8").split("\n").filter(v => v)
  18. }
  19. )