mirror of
https://github.com/FuelLabs/sway.git
synced 2025-08-09 05:08:17 +00:00

This PR is a WIP that aims to address the first 3 steps in #1833. This is in anticipation of using `forc test` to support unit testing (rather than Rust integration testing) #1832. The `forc test` command remains for now, but outputs a message explaining that the command is now reserved for unit testing and links to the issues above. ## TODO - [x] Create a new `sway-test-rs` repo or similar that can be used as a `cargo generate` template. - [x] Update Rust integration testing docs in the Sway book to describe how to use the `cargo generate` command to easily add Sway integration testing to an existing Rust project. ## Follow-up - Create a `forc-test-rs` crate that re-exports and extends `fuels` with useful `forc` functionality for integration testing (e.g. re-exporting `forc_pkg::build` to ensure sway code is built and available under `out/` at the start of testing).
358 B
358 B
EXAMPLE
$ mkdir my-fuel-project
$ cd my-fuel-project
$ forc init
$ tree
.
├── Forc.toml
└── src
└── main.sw
Forc.toml
is the Forc manifest file, containing information about the project and dependencies.
A src/
directory is created, with a single main.sw
Sway file in it.