Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: aperturerobotics/common
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.17.1
Choose a base ref
...
head repository: aperturerobotics/common
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.17.2
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Jul 10, 2024

  1. fix: test-browser pass full path to wasmbrowsertest

    Signed-off-by: Christian Stewart <christian@aperture.us>
    paralin committed Jul 10, 2024
    Copy the full SHA
    d003343 View commit details
  2. release: v0.17.2

    Signed-off-by: Christian Stewart <christian@aperture.us>
    paralin committed Jul 10, 2024
    Copy the full SHA
    2c7ff89 View commit details
Showing with 40 additions and 2 deletions.
  1. +4 −1 Makefile
  2. +35 −0 example/example_test.go
  3. +1 −1 package.json
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -184,7 +184,10 @@ test:
.PHONY: test-browser
test-browser: $(WASMBROWSERTEST)
cd $(PROJECT_DIR); \
GOOS=js GOARCH=wasm go test -exec $(WASMBROWSERTEST) -tags "webtests" -v ./...
GOOS=js GOARCH=wasm \
go test -exec $$(realpath $(WASMBROWSERTEST)) \
-tags "webtests" \
-v ./...

.PHONY: format
format: $(GOFUMPT) $(GOIMPORTS)
35 changes: 35 additions & 0 deletions example/example_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package example_test

import (
"testing"

"github.com/aperturerobotics/common/example"
"github.com/aperturerobotics/common/example/other"
)

func TestExampleMsg(t *testing.T) {
t.Run("should create an empty message", func(t *testing.T) {
msg := &example.ExampleMsg{}
if msg.ExampleField != "" {
t.Errorf("Expected empty ExampleField, got %q", msg.ExampleField)
}
if msg.OtherMsg != nil {
t.Error("Expected nil OtherMsg, got non-nil")
}
})

t.Run("should create a message with an example field", func(t *testing.T) {
msg := &example.ExampleMsg{ExampleField: "hello"}
if msg.ExampleField != "hello" {
t.Errorf("Expected ExampleField to be 'hello', got %q", msg.ExampleField)
}
})

t.Run("should create a message with an other message field", func(t *testing.T) {
other := &example_other.OtherMsg{FooField: 1}
msg := &example.ExampleMsg{OtherMsg: other}
if msg.OtherMsg.FooField != 1 {
t.Errorf("Expected OtherMsg.FooField to be 1, got %d", msg.OtherMsg.FooField)
}
})
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@aptre/common",
"description": "Common project configuration files and dependencies.",
"version": "0.17.1",
"version": "0.17.2",
"license": "MIT",
"author": {
"name": "Aperture Robotics LLC.",