mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: Add test helpers to improve coverage (#166)
* chore: Rename ProjectHistory to ProjectVersion Version more accurately represents version storage. This forks from the WorkspaceHistory name, but I think it's easier to understand Workspace history. * Rename files * Standardize tests a bit more * Remove Server struct from coderdtest * Improve test coverage for workspace history * Fix linting errors * Fix coderd test leak * Fix coderd test leak * Improve workspace history logs * Standardize test structure for codersdk * Fix linting errors * Fix WebSocket compression * Update coderd/workspaces.go Co-authored-by: Bryan <bryan@coder.com> * Add test for listing project parameters * Cache npm dependencies with setup node * Remove windows npm cache key Co-authored-by: Bryan <bryan@coder.com>
This commit is contained in:
+2
-2
@@ -2,7 +2,6 @@ package peer_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
@@ -17,6 +16,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"go.uber.org/goleak"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"cdr.dev/slog"
|
||||
"cdr.dev/slog/sloggers/slogtest"
|
||||
@@ -231,7 +231,7 @@ func TestConn(t *testing.T) {
|
||||
t.Parallel()
|
||||
conn, err := peer.Client([]webrtc.ICEServer{}, nil)
|
||||
require.NoError(t, err)
|
||||
expectedErr := errors.New("wow")
|
||||
expectedErr := xerrors.New("wow")
|
||||
_ = conn.CloseWithError(expectedErr)
|
||||
_, err = conn.Dial(context.Background(), "", nil)
|
||||
require.ErrorIs(t, err, expectedErr)
|
||||
|
||||
Reference in New Issue
Block a user