..
2024-09-17 13:58:08 -07:00
2017-01-18 17:47:43 +01:00
2024-09-24 11:46:46 -07:00
2017-01-18 17:47:43 +01:00
2024-09-16 10:48:17 -07:00
2017-01-18 01:06:30 +01:00
2017-01-18 17:47:43 +01:00
2017-04-23 14:51:58 +02:00
2022-08-17 12:04:05 -07:00

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.