Skip to content

Commit 9cadbe8

Browse files
committed
Fix tests failing with 'TypeError: Expected Buffer'
1 parent f8e0f82 commit 9cadbe8

File tree

7 files changed

+4121
-5
lines changed

7 files changed

+4121
-5
lines changed

.github/workflows/build-and-test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- 'Cargo.toml'
1212
- 'Cargo.lock'
1313
- 'package.json'
14-
- 'bun.lockb'
14+
- 'bun.lock'
1515

1616
env:
1717
SOLANA_VERSION: '2.1.0'
@@ -85,7 +85,7 @@ jobs:
8585
path: |
8686
~/.bun/install/cache
8787
node_modules
88-
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
88+
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
8989
restore-keys: ${{ runner.os }}-bun-
9090

9191
- name: Install Bun

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ anchor build
101101
bun test
102102
```
103103

104+
> [!NOTE]
105+
> Tests may fail with an `TypeError: Expected Buffer` error even with no code changes when bumping dependencies. Delete `node_modules`, `bun.lock`, reinstall dependencies and run tests again.
106+
104107
5. Deploy program
105108

106109
```bash

bun.lock

Lines changed: 4113 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bun.lockb

-706 KB
Binary file not shown.

tests/functional/cancelOrder.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ describe('cancelOrder', () => {
257257

258258
const postOrderAtaRent = litesvm.getBalance(orderAta);
259259

260-
expect(postOrderAtaRent).toBe(0n);
260+
expect(postOrderAtaRent).toBe(null);
261261

262262
const postTreasuryAta = await getAccount(provider.connection, treasuryAta);
263263

tests/functional/completeOrder.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ describe('completeOrder', () => {
231231

232232
const orderAtaRent = litesvm.getBalance(orderAta);
233233

234-
expect(orderAtaRent).toBe(0n);
234+
expect(orderAtaRent).toBe(null);
235235
});
236236

237237
test('throws if order status is not shipping', async () => {

tests/functional/unlistItem.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,6 @@ describe('unlistItem', () => {
8989

9090
const itemAccBal = litesvm.getBalance(itemPda);
9191

92-
expect(itemAccBal).toBe(0n);
92+
expect(itemAccBal).toBe(null);
9393
});
9494
});

0 commit comments

Comments
 (0)