{"id":23263164,"url":"https://github.com/wavesplatform/js-test-env","last_synced_at":"2025-08-20T18:34:59.239Z","repository":{"id":34933016,"uuid":"191718807","full_name":"wavesplatform/js-test-env","owner":"wavesplatform","description":"Environment for Mocha based Ride tests in Waves IDE and VS Code","archived":false,"fork":false,"pushed_at":"2023-03-03T01:00:19.000Z","size":1049,"stargazers_count":3,"open_issues_count":8,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-07T22:48:20.049Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wavesplatform.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-13T08:05:57.000Z","updated_at":"2022-07-09T23:07:56.000Z","dependencies_parsed_at":"2024-06-19T10:09:17.727Z","dependency_job_id":null,"html_url":"https://github.com/wavesplatform/js-test-env","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fjs-test-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fjs-test-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fjs-test-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fjs-test-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wavesplatform","download_url":"https://codeload.github.com/wavesplatform/js-test-env/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230445917,"owners_count":18227060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-19T14:15:03.772Z","updated_at":"2024-12-19T14:15:04.412Z","avatar_url":"https://github.com/wavesplatform.png","language":"TypeScript","readme":"# Testing environment form WAVES blockchain\n### How to ?\n\nImport package and write typescript/javascript code, interacting with waves blockchain. Package contains all global type definitions.\n#### Example using mocha test runner\n```typescript\nimport '@waves/js-test-env';\n\nenv.API_BASE = \"http://localhost:6869/\";\nenv.CHAIN_ID = \"R\";\nenv.SEED = \"waves private node seed with waves tokens\";\n\ndescribe('My first test suite', () =\u003e {\n    const wvs = 10 ** 8;\n    before(async function () {\n        this.timeout(0);\n        await setupAccounts({foo: 0.001 * wvs, bar: 0.001 * wvs});\n    });\n\n    it('Assertions', async function () {\n        const ttx = transfer({amount: 100000000000000, recipient: address()}, accounts.foo)\n        expect(ttx.proofs.length).to.equal(1)\n        await expect(broadcast(ttx)).rejectedWith()\n    })\n    // And define tests inside suites\n    // As you can see, we can use async functions to write async tests. sync functions have default timeout = 20s\n    it('Aks balance and height', async function () {\n        // You can set timeout. If you set it to zero, test won't finish untill function resolves\n        this.timeout(0);\n        // You can ask balance or currentHeigh\n        const b = await balance();\n        const h = await currentHeight();\n        // Console methods avalilable in test. Everything will be printed in repl\n        console.log(b, h)\n    })\n\n    it('Assertions', async function () {\n        const ttx = transfer({amount: 100000000000000, recipient: address()}, accounts.foo)\n        // Synchronous assertion\n        expect(ttx.proofs.length).to.equal(1)\n        // Async assertion. Expect broadcast to fail\n        await expect(broadcast(ttx)).rejectedWith()\n    })\n})\n\n```\n\n### [Here](https://wavesplatform.github.io/js-test-env/globals.html) you can find list of all globally available functions for ride test environment and REPL \n\nKeep in mind that by default, if not passed, `chainId`, `seed` and `nodeUrl` are taken from your test env configuration file (or Web IDE settings) \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavesplatform%2Fjs-test-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwavesplatform%2Fjs-test-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavesplatform%2Fjs-test-env/lists"}