Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pendle/sdk-core

Package Overview
Dependencies
Maintainers
7
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pendle/sdk-core

## Development Guideline

  • 0.2.2
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
7
Weekly downloads
 
Created
Source

Pendle SDK Rewrite

Development Guideline

Last update: 1 Dec 2021 By An Tran

My approach to TDD:

For a small library, in my opinion there should be two to three test levels:

  • Unit test: for each and every function or class
  • Module level integration tests: test the main exports of a given module (subfolders of the src folder).
    • This is optional if the library is small enough.
  • End-to-end tests (or acceptance tests): test the main export of the whole library.
    • This level tests the behaviour of the SDK toward library consumers.

Structure

  • The src folder is for writing the source code, unit tests and module level integration tests.
  • The src/index.ts file is the main export point of the library.
  • The test folder is for writing end-to-end tests
    • Those tests will test what the SDK user will use.
    • Note that those test must only import from the src/index.ts file, because this is the only place that user can reliably import anything from our library.

Commands

Along with the npm commands provided by tsdx, I have created several extra commands for development:

  • lint: this command is overrided, because tsdx doesn't provide a stable eslint configuration. May update later.
  • commitlint: run the commitlint. Included in the commit-msg hook, so you don't need to use this.
  • format: format the codebase with prettier.
  • test:{unit,e2e}: run the respective test scope. If we choose the unit scope, we will run the unit tests and integration tests, which resides in the src folder.
  • test:{unit,e2e}:cov: run a coverage test on the chosen test scope.
  • test:{unit,e2e}:watch: re-run the test suite on changes detected.
  • test:{unit,e2e}:debug: debug run the chosen test scope.
  • test:all: run all test scopes.
  • test:all:cov: run a coverage test on all test scope.
  • Reformat your code oftenly. You can run yarn format after a while, or set up the prettier plugin on your text editor/IDE.
  • Lint your code oftenly. You can run yarn lint after a while, or set up the eslint plugin on your text editor/IDE, which will show you lint errors.
  • Test your code as often as you can, or keep the test watch on.
  • Ensure your code pass the test:all:cov test before pushing. This test ensures that your code is fully tested with 80% coverage.
  • Write your commit message in commitlint convention.

FAQs

Package last updated on 08 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc