Struct wasm_bindgen_test_project_builder::Project [−][src]
pub struct Project { /* fields omitted */ }Methods
impl Project[src]
impl Projectpub fn file(&mut self, name: &str, contents: &str) -> &mut Project[src]
pub fn file(&mut self, name: &str, contents: &str) -> &mut ProjectAdd 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 ProjectEnable 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 ProjectDepend 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 ProjectDepend 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 ProjectGenerate 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 ProjectDepend 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 ProjectEnables 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 ProjectEnables 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 ProjectAdd a path dependency to the generated project
pub fn crate_name(&self) -> String[src]
pub fn crate_name(&self) -> StringReturns 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 ProjectFlag 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 ProjectThis 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) -> StringReads JS generated by wasm-bindgen to a string.