mirror of
https://github.com/protobufjs/protobuf.js.git
synced 2025-12-08 20:58:55 +00:00
* Update type deps Remove duplicate `long` types * Fix type tests Co-authored-by: Alexander Fenster <fenster@google.com>
634 B
634 B
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, notloadSync - Use
Reader.create, notBufferReader - Use
Writer.create, notBufferWriter - 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.