Skip to content

Commit

Permalink
Merge pull request #16 from sigma-andex/add-integration-test-setup
Browse files Browse the repository at this point in the history
Add basic integration test setup
  • Loading branch information
FL33TW00D authored Jan 20, 2024
2 parents 35f4f17 + 469d520 commit b8ba570
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Rust

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup
run: |
cargo install wasm-pack
- name: Build
run: cargo build
- name: Run tests
run: cargo test
- name: Run integration tests
run: (cd crates/integration-tests;sh run-tests.sh)
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[workspace]
members = [
"crates/integration-tests",
"crates/ratchet-core",
"crates/ratchet-loader",
"crates/ratchet-models",
Expand Down
9 changes: 9 additions & 0 deletions crates/integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "ratchet-integration-tests"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dev-dependencies]
wasm-bindgen-test = "0.3.34"
2 changes: 2 additions & 0 deletions crates/integration-tests/run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
wasm-pack test --chrome --headless
1 change: 1 addition & 0 deletions crates/integration-tests/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

8 changes: 8 additions & 0 deletions crates/integration-tests/tests/integration.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
use wasm_bindgen_test::*;

wasm_bindgen_test_configure!(run_in_browser);

#[wasm_bindgen_test]
fn pass() {
assert_eq!(1, 1);
}

0 comments on commit b8ba570

Please sign in to comment.