Skip to content

Latest commit

 

History

History
60 lines (50 loc) · 1.84 KB

README.md

File metadata and controls

60 lines (50 loc) · 1.84 KB

Testing AlgonautJS

setup

  • install taskfile
    • brew install go-task/tap/go-task
  • install dotenv globally
    • npm i -g dotenv
  • configure .env
    • set NCC_BASE_SERVER, NCC_API_TOKEN, etc
    • FYI env vars need to have prefix NCC_ to work w vite server

run tests

  1. task prepare-algonautjs
    • installs algonautjs deps + builds lib + links pkg locally
  2. task prepare-tests
    • installs test dir deps + links to local instance of @thencc/algonautjs
  3. task tests
    • runs task called "tests" which runs all tasks defined in yaml
    • FYI, there are many logs... but no errors in the console is a win
    • list all tasks: task --list
    • run 1 specific test: task TASK_NAME

testing import/require

algonautjs should work in all js/ts contexts. but to be sure, we automate the various types of initializations such as:

unit tests

Unit tests for algonaut are in algonaut.test.ts. Run them with:

npm run test

Unit tests require ALGONAUT_TEST_MNEMONIC to be set in the environment (.env is fine). This account must have a little bit of Algo in it to run the tests.

notes

  • don't mock code you don't own! APIs change all the time! :)