Skip to content
This repository was archived by the owner on Sep 19, 2025. It is now read-only.

Commit c25636d

Browse files
committed
update tests to latest format
1 parent af2160a commit c25636d

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

js/app.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { App, PeerClaims, PeerPolicy } from "./pkg-bundler/pulsebeam_core.js";
22

33
const app = new App(
4-
"kid_Ycl5ClRWJWNw8bqB25DMH",
5-
"sk_e63bd11ff7491adc5f7cca5a4566b94d75ea6a9bafcd68252540eaa493a42109",
4+
"kid_73d8caa6c387d46c",
5+
"sk_7edea599046490dfd271b863b03398d2b613812b1f23efd023ca3b08026d3e67",
66
);
77

88
const claims = new PeerClaims("default", "alice");

js/app.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Deno.test({
55
name: "create token",
66
fn: () => {
77
const app = new App(
8-
"kid_Ycl5ClRWJWNw8bqB25DMH",
9-
"sk_e63bd11ff7491adc5f7cca5a4566b94d75ea6a9bafcd68252540eaa493a42109",
8+
"kid_73d8caa6c387d46c",
9+
"sk_7edea599046490dfd271b863b03398d2b613812b1f23efd023ca3b08026d3e67",
1010
);
1111

1212
const claims = new PeerClaims("default", "alice");

src/lib.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use wasm_bindgen::prelude::*;
3131
// ```ts
3232
// // Step 1: Initialize app
3333
// const { PULSEBEAM_API_KEY, PULSEBEAM_API_SECRET } = process.env;
34-
// const app = new App(PULSEBEAM_API_KEY, PULSEBEAM_API_SECRET);
34+
// const app = new AccessToken(PULSEBEAM_API_KEY, PULSEBEAM_API_SECRET);
3535
//
3636
// // Step 2: Listen for JWT requests from your clients'
3737
// router.post('/auth', (req, res) => {
@@ -202,7 +202,7 @@ impl PeerPolicy {
202202
///
203203
/// ```ts
204204
/// const { PULSEBEAM_API_KEY, PULSEBEAM_API_SECRET } = process.env;
205-
/// const app = new App(PULSEBEAM_API_KEY, PULSEBEAM_API_SECRET);
205+
/// const app = new AccessToken(PULSEBEAM_API_KEY, PULSEBEAM_API_SECRET);
206206
///
207207
/// router.post('/auth', (req, res) => {
208208
/// const claims = new PeerClaims("myGroup1", "myPeer1");
@@ -214,24 +214,24 @@ impl PeerPolicy {
214214
/// res.json({ groupId, peerId, token });
215215
/// });```
216216
#[wasm_bindgen]
217-
pub struct App {
217+
pub struct AccessToken {
218218
#[wasm_bindgen(skip)]
219219
pub api_key: String,
220220
#[wasm_bindgen(skip)]
221221
pub api_secret: String,
222222
}
223223

224224
#[wasm_bindgen]
225-
impl App {
226-
/// Creates a new `App` instance using your config. Essential for creating
225+
impl AccessToken {
226+
/// Creates a new `AccessToken` instance using your config. Essential for creating
227227
/// client tokens.
228228
///
229229
/// Get an api_key and api_secret from {@link https://pulsebeam.dev}
230230
///
231231
/// # Examples
232232
///
233233
/// ```ts
234-
/// const app = new App(MY_API_KEY, MY_API_SECRET);```
234+
/// const app = new AccessToken(MY_API_KEY, MY_API_SECRET);```
235235
#[wasm_bindgen(constructor)]
236236
pub fn new(api_key: &str, api_secret: &str) -> Self {
237237
Self {
@@ -301,9 +301,9 @@ mod tests {
301301

302302
#[test]
303303
fn test_create_token() -> anyhow::Result<()> {
304-
let app = App::new(
305-
"kid_Ycl5ClRWJWNw8bqB25DMH",
306-
"sk_e63bd11ff7491adc5f7cca5a4566b94d75ea6a9bafcd68252540eaa493a42109",
304+
let app = AccessToken::new(
305+
"kid_73d8caa6c387d46c",
306+
"sk_7edea599046490dfd271b863b03398d2b613812b1f23efd023ca3b08026d3e67",
307307
);
308308

309309
let claims = PeerClaims::new("default", "alice");

0 commit comments

Comments
 (0)