Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 634 Bytes

README.md

File metadata and controls

18 lines (13 loc) · 634 Bytes

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, but TypeScript tests must import the type from "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.