diff options
| author | Li Zhineng <[email protected]> | 2025-07-02 21:29:40 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-02 21:29:40 +0800 |
| commit | 72e1c3cb3430a19cc4d5b1d1f57bc40be8d10036 (patch) | |
| tree | e98b6314e0c82de97348601bf571b832a253f934 /server.test.mjs | |
| parent | fd5876743c2070a5259c36110e7e02f80ed80458 (diff) | |
| parent | 72643a9424fc8e71d0360d710581c194fe6ba945 (diff) | |
| download | server-72e1c3cb3430a19cc4d5b1d1f57bc40be8d10036.tar.gz server-72e1c3cb3430a19cc4d5b1d1f57bc40be8d10036.zip | |
Eagle online controller
Diffstat (limited to 'server.test.mjs')
| -rw-r--r-- | server.test.mjs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/server.test.mjs b/server.test.mjs index 1e44083..24437b6 100644 --- a/server.test.mjs +++ b/server.test.mjs @@ -142,6 +142,22 @@ test('device registration endpoint returns not found if path is not supported', assert.strictEqual(res.status, 404) }) +test('device status endpoint', async () => { + const params = new URLSearchParams({ + source: 5, + reqid: '0000000000', + eagleId: 1, + path: 'eagle/GET/online', + params: '{}', + sig: '00000000000000000000000000000000' + }) + const res = await fetch(`${baseUrl}/eagle?${params.toString()}`) + assert.strictEqual(res.status, 200) + const data = await res.json() + assert.strictEqual(data.data.snow, 1) + assert.strictEqual(data.data.eagle, 1) +}) + test('exchange endpoint', async () => { const stubMacAddress = '0000000000' const stubKey = '00000000000000000000000000000000' |
