Struct wasm_bindgen_test_project_builder::Project [−][src]
pub struct Project { /* fields omitted */ }
Methods
impl Project
[src]
impl Project
pub fn file(&mut self, name: &str, contents: &str) -> &mut Project
[src]
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.
pub fn debug(&mut self, debug: bool) -> &mut Project
[src]
pub fn debug(&mut self, debug: bool) -> &mut Project
Enable debug mode in wasm-bindgen for this test
pub fn no_std(&mut self, no_std: bool) -> &mut Project
[src]
pub fn no_std(&mut self, no_std: bool) -> &mut Project
Depend on wasm-bindgen
without the std
feature enabled.
pub fn serde(&mut self, serde: bool) -> &mut Project
[src]
pub fn serde(&mut self, serde: bool) -> &mut Project
Depend on the serde
feature of wasm-bindgen
pub fn rlib(&mut self, rlib: bool) -> &mut Project
[src]
pub fn rlib(&mut self, rlib: bool) -> &mut Project
Generate an rlib instead of a cdylib in the generated Cargo project
pub fn depend(&mut self, dep: &str) -> &mut Project
[src]
pub fn depend(&mut self, dep: &str) -> &mut Project
Depend on a crate from crates.io, like serde.
pub fn nodejs_experimental_modules(&mut self, node: bool) -> &mut Project
[src]
pub fn nodejs_experimental_modules(&mut self, node: bool) -> &mut Project
Enables or disables node.js experimental modules output
pub fn webpack(&mut self, webpack: bool) -> &mut Project
[src]
pub fn webpack(&mut self, webpack: bool) -> &mut Project
Enables or disables the usage of webpack for this project
pub fn add_local_dependency(&mut self, name: &str, path: &str) -> &mut Project
[src]
pub fn add_local_dependency(&mut self, name: &str, path: &str) -> &mut Project
Add a path dependency to the generated project
pub fn crate_name(&self) -> String
[src]
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.
pub fn requires_bigint(&mut self) -> &mut Project
[src]
pub fn requires_bigint(&mut self) -> &mut Project
Flag this project as requiring bigint support in Node
pub fn headless(&mut self, headless: bool) -> &mut Project
[src]
pub fn headless(&mut self, headless: bool) -> &mut Project
This test requires a headless web browser
pub fn build(&mut self) -> (PathBuf, PathBuf)
[src]
pub fn build(&mut self) -> (PathBuf, PathBuf)
Write this project to the filesystem, ensuring all files are ready to go.
pub fn cargo_build(&mut self) -> (PathBuf, PathBuf)
[src]
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.
pub fn gen_bindings(&mut self) -> (PathBuf, PathBuf)
[src]
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.
pub fn test(&mut self)
[src]
pub fn test(&mut self)
Execute this project's run.js
, ensuring that everything runs through
node or a browser correctly
pub fn read_js(&self) -> String
[src]
pub fn read_js(&self) -> String
Reads JS generated by wasm-bindgen
to a string.