Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Releases: onflow/flow-js-testing

v0.3.0-alpha.10

08 Jul 22:57
92dc68d
Compare
Choose a tag to compare
v0.3.0-alpha.10 Pre-release
Pre-release

Patch Changes

  • #138 e807e83 Thanks @jribbink! - Version bump @onflow/flow-cadut (fixes "transaction" keyword not allowed in templates & adds PublicPath/PrivatePath/StoragePath/CapabilityPath argument compatibility)

v0.3.0-alpha.9

07 Jul 21:33
33d8f28
Compare
Choose a tag to compare
v0.3.0-alpha.9 Pre-release
Pre-release

Minor Changes

  • #126 3fc34f3 Thanks @refi93! - Add getTimeOffset/setTimeOffset utilities, allowing to advance the time while testing smart-contracts

  • #129 78944c1 Thanks @jribbink! - Add optional error message match to shallRevert Jest assertion

v0.3.0-alpha.8

04 Jul 17:32
ba2de53
Compare
Choose a tag to compare
v0.3.0-alpha.8 Pre-release
Pre-release

Minor Changes

  • 033562b: Dynamically select ports for emulator instead of supplying admin port statically through emulator.start arguments, deprecate use of this argument

v0.2.2 Upgrade how to detect emulator readiness

13 Jan 16:50
8ea6adb
Compare
Choose a tag to compare

What's Changed

Instead of reading logging lines from the emulator, the flow-js-testing library now makes a gRPC API call via FCL on getBlock() API to determine if the emulator is fully started. This change will address the intermittent test failures caused by prematurely flags emulator in a ready state.

New Contributors

Full Changelog: v0.2.1...v0.2.2

Fixed getContractAddress method

09 Dec 20:45
4639dfb
Compare
Choose a tag to compare

Due to refactoring getContractAddress method was returning a tuple, which would lead to a trailing comma inside of the import statement and breaking of most of interactions. We've spotted what was causing this behaviour, fixed it and added additional tests to prevent this from happening in the future 😁

Major Update - Return Value

08 Dec 18:07
f19756f
Compare
Choose a tag to compare

Interaction Return Value

sendTransaction and executeScript functions now return a tuple of [result, error]. As do the following functions:

  • updateContract

  • setBlockOffset

  • registerContract

  • mintTokens

  • initManager

  • deployContract

  • createAccount

  • setBlockOffset

  • mintFlow

  • getManagerAddress

  • getContractAddress

  • getBlockOffset

  • getBalance

  • getAccountAddress

  • checkManager

  • getBlockOffset

  • getFlowBalance

Any code that relies upon checking the result of any of these functions and expects only the result returned will need to be refactored.
Jest asserts were updated accordingly, but if you were writing your own you will need to update them.
For examples of new usage see the script, transaction and api documentation.

Limited Interactions

21 Nov 22:03
fbe8432
Compare
Choose a tag to compare

Interaction Limit

Both scripts and transactions now accepts limit field for all your heavy interactions. Default value is 999

Package Updates

flow-cadut and other supporting packages were updated to latest versions

Block Offsets and Argument Resolvers

08 Oct 18:42
1ccf76e
Compare
Choose a tag to compare

⭐️ Block Offset Functionality

With this release we are adding functionality to offset current block height by calling setBlockOffset method. This should enable time based lock functionality in your contracts, transactions and scripts. Please refer to API in documentation for available methods and examples.

⭐️ Runnable Examples

On top of examples you can find in documentation we added several examples showcasing usage of framework to examples folder. You can run any of the example located there with simple node run {name | number} command from withing that folder.

⭐️ Fixed Complex Arguments

Updated version of flow-cadut will help resolve complex arguments like arrays of dictionaries with ease.

Version 0.1.13

05 Aug 22:05
1e35afb
Compare
Choose a tag to compare

⭐ Bootstrap Testing Environment

You can initiate your testing environment with one simple command:

npx flow-js-testing init

⭐ Generate Test Suit

Create a test suit file for your project with all the necessary imports and setup for describe blocks.

npx flow-js-testing make [name]

You can start writing your asserts and expectations right away.

Updated Dependencies

flow-cadut dependency is fixed and now arguments with complex types - i.e. metadata of {String:String} - should work properly.

Fixed Emulator Logging

Previously emulator would cause Jest to throw an error after test is executed, when logging option is set to true. This issue is fixed now.

Update for new `flow.json` schema

20 Jul 07:42
a90459d
Compare
Choose a tag to compare

Flow CLI version v.0.25.1 changed plural keys to singular key on service account, breaking the framework.
init method will now properly source it's value from key field and provides a fallback in case similar case occur in the future.
port and pkey can now be passed via options object as second argument:

const port = 8080;
const pkey = "48a1f554aeebf6bf9fe0d7b5b79d080700b073ee77909973ea0b2f6fbc902"

await init(basePath, { port, pkey });

Both of them are optional, so if you are OK with default values, you can make it into one-liner:

await init(basePath);