pub struct Project { /* private fields */ }
Implementations§
Source§impl Project
impl Project
Sourcepub fn file(&mut self, name: &str, contents: &str) -> &mut Project
pub fn file(&mut self, name: &str, contents: &str) -> &mut Project
Add a new file with the specified contents to this project, the name
can have slahes for files in subdirectories.
Sourcepub fn debug(&mut self, debug: bool) -> &mut Project
pub fn debug(&mut self, debug: bool) -> &mut Project
Enable debug mode in wasm-bindgen for this test
Sourcepub fn no_std(&mut self, no_std: bool) -> &mut Project
pub fn no_std(&mut self, no_std: bool) -> &mut Project
Depend on wasm-bindgen
without the std
feature enabled.
Sourcepub fn serde(&mut self, serde: bool) -> &mut Project
pub fn serde(&mut self, serde: bool) -> &mut Project
Depend on the serde
feature of wasm-bindgen
Sourcepub fn rlib(&mut self, rlib: bool) -> &mut Project
pub fn rlib(&mut self, rlib: bool) -> &mut Project
Generate an rlib instead of a cdylib in the generated Cargo project
Sourcepub fn depend(&mut self, dep: &str) -> &mut Project
pub fn depend(&mut self, dep: &str) -> &mut Project
Depend on a crate from crates.io, like serde.
Sourcepub fn nodejs_experimental_modules(&mut self, node: bool) -> &mut Project
pub fn nodejs_experimental_modules(&mut self, node: bool) -> &mut Project
Enables or disables node.js experimental modules output
Sourcepub fn webpack(&mut self, webpack: bool) -> &mut Project
pub fn webpack(&mut self, webpack: bool) -> &mut Project
Enables or disables the usage of webpack for this project
Sourcepub fn add_local_dependency(&mut self, name: &str, path: &str) -> &mut Project
pub fn add_local_dependency(&mut self, name: &str, path: &str) -> &mut Project
Add a path dependency to the generated project
Sourcepub fn crate_name(&self) -> String
pub fn crate_name(&self) -> String
Returns the crate name that will be used for the generated crate, this name changes between test runs and is generated at runtime.
Sourcepub fn requires_bigint(&mut self) -> &mut Project
pub fn requires_bigint(&mut self) -> &mut Project
Flag this project as requiring bigint support in Node
Sourcepub fn headless(&mut self, headless: bool) -> &mut Project
pub fn headless(&mut self, headless: bool) -> &mut Project
This test requires a headless web browser
Sourcepub fn build(&mut self) -> (PathBuf, PathBuf)
pub fn build(&mut self) -> (PathBuf, PathBuf)
Write this project to the filesystem, ensuring all files are ready to go.
Sourcepub fn cargo_build(&mut self) -> (PathBuf, PathBuf)
pub fn cargo_build(&mut self) -> (PathBuf, PathBuf)
Build the Cargo project for the wasm target, returning the root of the project and the target directory where output is located.
Sourcepub fn gen_bindings(&mut self) -> (PathBuf, PathBuf)
pub fn gen_bindings(&mut self) -> (PathBuf, PathBuf)
Generate wasm-bindgen bindings for the compiled artifacts of this project, returning the root of the project as well as the target directory where output was generated.