tree: cae980e334412676ca2eb848cd4f2ad0d6265209 [path history] [tgz]
  1. data/
  2. node/
  3. split/
  4. api_Class.js
  5. api_common.js
  6. api_converters.js
  7. api_enum.js
  8. api_field.js
  9. api_inheritance.js
  10. api_longbits.js
  11. api_mapfield.js
  12. api_namespace.js
  13. api_object.js
  14. api_oneof.js
  15. api_reader-writer-reuse.js
  16. api_root-deferred.js
  17. api_root-expose.js
  18. api_root.js
  19. api_service-rpc-streaming.js
  20. api_service-rpc.js
  21. api_service.js
  22. api_tokenize.js
  23. api_type.js
  24. api_util.js
  25. api_writer-reader.js
  26. cli.js
  27. comment_serialization.js
  28. comp_ambiguous-names.js
  29. comp_bytes.js
  30. comp_empty-encode.js
  31. comp_empty-inner-fields.js
  32. comp_extend.js
  33. comp_fixed64-grpc.js
  34. comp_google_protobuf_any.js
  35. comp_groups.js
  36. comp_jspb-test.js
  37. comp_long-tags.js
  38. comp_maps.js
  39. comp_negative-int32.js
  40. comp_oneof.js
  41. comp_optional.js
  42. comp_options-parse.js
  43. comp_options-textformat.js
  44. comp_packed-repeated.js
  45. comp_parse-uncommon.js
  46. comp_repeated-message.js
  47. comp_sfixed64-grpc.js
  48. comp_typescript.js
  49. comp_typescript.ts
  50. docs_comments.js
  51. docs_comments_alternate_parse.js
  52. lib_aspromise.js
  53. lib_base64.js
  54. lib_codegen.js
  55. lib_eventemitter.js
  56. lib_inquire.js
  57. lib_path.js
  58. lib_pool.js
  59. other_basics-debug.js
  60. other_bench.js
  61. other_classes.js
  62. other_node-or-browser.js
  63. other_protocolerror.js
  64. README.md
tests/README.md

This folder contains all the tests, one per file.

It is essential that tests only use the cross-platform API that is also available in browsers:

  • Use load, not loadSync
  • Use Reader.create, not BufferReader
  • Use Writer.create, not BufferWriter
  • It is safe to use Long

If it's absolutely inevitable for your test case to use node-specific features, you can still use this pattern:

if (protobuf.util.isNode) {
    // node-specific tests
}

Why? Tests are run both under node.js and within all kinds of modern to ancient browsers automatically.