0.0.1-beta.17 • Published 4 years ago

@virtru/nanotdf v0.0.1-beta.17

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

NanoTDF

⚠️ Warning

This library is in continual development. The current implementation of NanoTDF library is as follows, but expect issues.

  • Parse binary
    • happy paths
    • sad paths
    • 80% code coverage
  • Decrypt nanoTDF
  • Encrypt nanoTDF
  • Encode binary

Build

The nanoTDF library will build two version. The difference between these version is slight, but significant.

  • Node /build
  • Browser /build-browser

To build run:

npm i
npm run build

Testing

There are three significant tests:

  • Node unit tests, located /src/**/*.test.ts
  • Node functional tests, located /tests/*.test.ts
  • Browser functional tests, located /tests/*.test-browser.js

To run the node unit tests and functional tests:

npm i
npm run test

To run the browser functional tests:

npm i
npm run build
open ./tests/browser-tests/index.html

Adding tests

Node tests:

  • Keep unit tests along side the scripts /src/**/<scriptName>.test.ts
  • Keep functional tests within /tests and give it a meaningful name

Browser tests:

  • Keep functional tests within /tests/browser-tests and give it a meaningful name
  • Add helpers to /tests/browser-tests/helpers.js
  • Add fixtures to /tests/browser-tests/fixtures.js as const fixtures_myNewFixture = {};
  • Add test to the /tests/browser-tests/index.html within the test comments boundary