Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2209 from holochain/scenario-await-sleep
Browse files Browse the repository at this point in the history
Replace s.consistency with sleep fn in scaffold
  • Loading branch information
zippy committed Sep 30, 2020
2 parents 72b35f1 + 44bb066 commit e379468
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG-UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

### Removed

* Replaced `await s.consistency()` with generic JS sleep function in scenario test scaffold template [#2209](https://github.com/holochain/holochain-rust/pull/2209)

### Fixed

### Security
Expand Down
5 changes: 3 additions & 2 deletions crates/cli/src/cli/js-tests-scaffold/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ orchestrator.registerScenario("description of example test", async (s, t) => {
// indicating the function, and passing it an input
const addr = await alice.call("myInstanceName", "my_zome", "create_my_entry", {"entry" : {"content":"sample content"}})

// Wait for all network activity to settle
await s.consistency()
// Wait 1s for all network activity to settle; you may need to adjust this
// number to suit your scenario.
await new Promise(r => setTimeout(r, 1000));

const result = await bob.call("myInstanceName", "my_zome", "get_my_entry", {"address": addr.Ok})

Expand Down

0 comments on commit e379468

Please sign in to comment.