mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 21:15:32 +09:00
test: remove infrastructure-dependent integration suites (#1573)
This commit is contained in:
1 parent
f88b0f69b2
commit
10fc79ab37
199 files changed
+688
-46963
No files matched your search
@@ -2,37 +2,21 @@
|
||||
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import webauthn from '../index.js';
|
||||
import webauthnPure from '../pure.cjs';
|
||||
|
||||
test('loader resolves supported native filenames', () => {
|
||||
assert.equal(webauthn._private.nativeFileName('darwin', 'x64'), 'webauthn.darwin-x64.node');
|
||||
assert.equal(webauthn._private.nativeFileName('darwin', 'arm64'), 'webauthn.darwin-arm64.node');
|
||||
assert.equal(webauthn._private.nativeFileName('linux', 'x64'), 'webauthn.linux-x64-gnu.node');
|
||||
assert.equal(webauthn._private.nativeFileName('linux', 'arm64'), 'webauthn.linux-arm64-gnu.node');
|
||||
assert.equal(webauthn._private.nativeFileName('win32', 'x64'), 'webauthn.win32-x64-msvc.node');
|
||||
assert.equal(webauthn._private.nativeFileName('win32', 'arm64'), 'webauthn.win32-arm64-msvc.node');
|
||||
assert.equal(webauthn._private.nativeFileName('freebsd', 'x64'), null);
|
||||
});
|
||||
|
||||
test('loader exposes the Fluxer WebAuthn surface', async () => {
|
||||
assert.equal(typeof webauthn.create, 'function');
|
||||
assert.equal(typeof webauthn.get, 'function');
|
||||
assert.equal(typeof webauthn.getBackendInfo, 'function');
|
||||
assert.equal(typeof webauthn.isSupported, 'function');
|
||||
const info = webauthn.getBackendInfo();
|
||||
const supported = await webauthn.isSupported();
|
||||
assert.equal(typeof supported, 'boolean');
|
||||
assert.equal(supported, info.supported);
|
||||
assert.equal(typeof info, 'object');
|
||||
assert.equal(typeof info.target, 'string');
|
||||
assert.equal(typeof info.backend, 'string');
|
||||
assert.equal(typeof info.supported, 'boolean');
|
||||
assert.equal(typeof info.ceremoniesImplemented, 'boolean');
|
||||
assert.equal(webauthnPure.nativeFileName('darwin', 'x64'), 'webauthn.darwin-x64.node');
|
||||
assert.equal(webauthnPure.nativeFileName('darwin', 'arm64'), 'webauthn.darwin-arm64.node');
|
||||
assert.equal(webauthnPure.nativeFileName('linux', 'x64'), 'webauthn.linux-x64-gnu.node');
|
||||
assert.equal(webauthnPure.nativeFileName('linux', 'arm64'), 'webauthn.linux-arm64-gnu.node');
|
||||
assert.equal(webauthnPure.nativeFileName('win32', 'x64'), 'webauthn.win32-x64-msvc.node');
|
||||
assert.equal(webauthnPure.nativeFileName('win32', 'arm64'), 'webauthn.win32-arm64-msvc.node');
|
||||
assert.equal(webauthnPure.nativeFileName('freebsd', 'x64'), null);
|
||||
});
|
||||
|
||||
test('normalization creates spec-shaped client data and Windows transport bits', () => {
|
||||
const challenge = Buffer.from([1, 2, 3, 4]);
|
||||
const normalized = webauthn._private.normalizeCreateOptions({
|
||||
const normalized = webauthnPure.normalizeCreateOptions({
|
||||
origin: 'https://web.canary.fluxer.app/channels/@me',
|
||||
challenge,
|
||||
rp: {id: 'fluxer.app', name: 'Fluxer'},
|
||||
|
||||
Reference in new issue
Block a user