This is the unpublished documentation of wasm-bindgen, the published documentation is available on the main Rust and WebAssembly documentation site . Features documented here may not be available in released versions of wasm-bindgen.

Setting Up Continuous Integration with wasm-bindgen-test

This page contains example configurations for running wasm-bindgen-test-based tests in various CI services.

Is your favorite CI service missing? Send us a pull request!

Travis CI

language: rust
rust: nightly

  firefox: latest
  chrome: stable

  - rustup target add wasm32-unknown-unknown
  # Downloads a `wasm-bindgen` release binary from
  # Alternatively, use `wasm-pack` to manage `wasm-bindgen` binaries for you
  - curl -OL
  - tar xf wasm-bindgen-0.2.21-x86_64-unknown-linux-musl.tar.gz
  - chmod +x wasm-bindgen-0.2.21-x86_64-unknown-linux-musl/wasm-bindgen
  # Moves the binaries to a directory that is in your PATH
  - mv wasm-bindgen-0.2.21-x86_64-unknown-linux-musl/wasm-bindgen* ~/.cargo/bin 
  # Install node.js with nvm.
  - curl -o- | bash
  - source ~/.nvm/
  - nvm install v10.5
  # Install chromedriver.
  - curl --retry 5 -LO
  - unzip
  # Install geckodriver.
  - curl --retry 5 -LO
  - tar xf geckodriver-v0.21.0-linux64.tar.gz

  # Test in Chrome.
  - CHROMEDRIVER=$(pwd)/chromedriver cargo test --target wasm32-unknown-unknown
  # Test in Firefox.
  - GECKODRIVER=$(pwd)/geckodriver cargo test --target wasm32-unknown-unknown


  - ps: Install-Product node 10
  - appveyor-retry appveyor DownloadFile -FileName rustup-init.exe
  - rustup-init.exe -y --default-host x86_64-pc-windows-msvc --default-toolchain nightly
  - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
  - rustc -V
  - cargo -V
  - rustup target add wasm32-unknown-unknown
  - cargo install wasm-bindgen-cli

build: false

  # Test in Chrome. chromedriver is installed by default in appveyor.
  - set CHROMEDRIVER=C:\Tools\WebDriver\chromedriver.exe
  - cargo test --target wasm32-unknown-unknown
  # Test in Firefox. geckodriver is also installed by default.
  - set GECKODRIVER=C:\Tools\WebDriver\geckodriver.exe
  - cargo test --target wasm32-unknown-unknown