Skip to content

Commit

Permalink
[bcs] Add BCS Spec (#480)
Browse files Browse the repository at this point in the history
* [bcs] Add remaining function to tell remaining deserializing bytes

* [bcs] Add BCS spec to verify across SDKs

The main purpose of the spec is to check the same tests across multiple
SDKs and ensure that they're consistent.

* [spec] Convert match patterns to regex

* [spec] Use cucumber directly rather than the node_modules
  • Loading branch information
gregnazario authored Aug 19, 2024
1 parent 7963ef1 commit 881517f
Show file tree
Hide file tree
Showing 8 changed files with 1,269 additions and 18 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ All notable changes to the Aptos TypeScript SDK will be captured in this file. T
- Update Indexer GraphQL schema
- Add `convertAmountFromHumanReadableToOnChain` and `convertAmountFromOnChainToHumanReadable` helper methods
- Export `helpers.ts` file
- Add `remaining()` function to deserializer, to tell remaining byte size
- Add BCS spec for testing purposes with Cucumber

# 1.26.0 (2024-07-18)

Expand Down
11 changes: 11 additions & 0 deletions cucumber.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// cucumber.js
let common = [
'tests/features/**/*.feature', // Specify our feature files
'--loader ts-node/esm',
'--import tests/step-definitions/**/*.mts', // Load step definitions
'--format progress-bar', // Load custom formatter
].join(' ');

module.exports = {
default: common
};
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@
"indexer-codegen": "graphql-codegen --config ./src/types/codegen.yaml && pnpm fmt",
"doc": "scripts/generateDocs.sh",
"check-version": "scripts/checkVersion.sh",
"update-version": "scripts/updateVersion.sh && pnpm doc"
"update-version": "scripts/updateVersion.sh && pnpm doc",
"spec": "pnpm build && pnpm _spec",
"_spec": "cucumber-js -p default"
},
"dependencies": {
"@aptos-labs/aptos-client": "^0.1.0",
"@aptos-labs/aptos-cli": "^0.2.0",
"@aptos-labs/aptos-client": "^0.1.0",
"@noble/curves": "^1.4.0",
"@noble/hashes": "^1.4.0",
"@scure/bip32": "^1.4.0",
Expand All @@ -62,6 +64,7 @@
},
"devDependencies": {
"@babel/traverse": "^7.23.6",
"@cucumber/cucumber": "^10.8.0",
"@graphql-codegen/cli": "^5.0.0",
"@graphql-codegen/import-types-preset": "^3.0.0",
"@graphql-codegen/typescript": "^4.0.1",
Expand Down
Loading

0 comments on commit 881517f

Please sign in to comment.