File tree Expand file tree Collapse file tree 2 files changed +55
-0
lines changed Expand file tree Collapse file tree 2 files changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ import {
2
+ createKey ,
3
+ getKeys ,
4
+ isDeviceSupported ,
5
+ isPassKeyAvailable ,
6
+ } from "@near-js/biometric-ed25519" ;
7
+ import { KeyPair } from "@near-js/crypto" ;
8
+ import { expectTypeOf , test } from "vitest" ;
9
+
10
+ test ( `exports "createKey" function with correct type` , async ( ) => {
11
+ type ExpectedFunction = ( username : string ) => Promise < KeyPair > ;
12
+
13
+ expectTypeOf ( createKey ) . toEqualTypeOf < ExpectedFunction > ( ) ;
14
+ } ) ;
15
+
16
+ test ( `exports "getKeys" function with correct type` , async ( ) => {
17
+ type ExpectedFunction = ( username : string ) => Promise < [ KeyPair , KeyPair ] > ;
18
+
19
+ expectTypeOf ( getKeys ) . toEqualTypeOf < ExpectedFunction > ( ) ;
20
+ } ) ;
21
+
22
+ test ( `exports "isDeviceSupported" function with correct type` , async ( ) => {
23
+ type ExpectedFunction = ( ) => Promise < boolean > ;
24
+
25
+ expectTypeOf ( isDeviceSupported ) . toEqualTypeOf < ExpectedFunction > ( ) ;
26
+ } ) ;
27
+
28
+ test ( `exports "isPassKeyAvailable" function with correct type` , async ( ) => {
29
+ type ExpectedFunction = ( ) => Promise < boolean > ;
30
+
31
+ expectTypeOf ( isPassKeyAvailable ) . toEqualTypeOf < ExpectedFunction > ( ) ;
32
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import {
2
+ createKey ,
3
+ getKeys ,
4
+ isDeviceSupported ,
5
+ isPassKeyAvailable ,
6
+ } from "@near-js/biometric-ed25519" ;
7
+ import { expect , test } from "vitest" ;
8
+
9
+ test ( `exports "createKey" function` , ( ) => {
10
+ expect ( createKey ) . toBeDefined ( ) ;
11
+ } ) ;
12
+
13
+ test ( `exports "getKeys" function` , ( ) => {
14
+ expect ( getKeys ) . toBeDefined ( ) ;
15
+ } ) ;
16
+
17
+ test ( `exports "isDeviceSupported" function` , ( ) => {
18
+ expect ( isDeviceSupported ) . toBeDefined ( ) ;
19
+ } ) ;
20
+
21
+ test ( `exports "isPassKeyAvailable" function` , ( ) => {
22
+ expect ( isPassKeyAvailable ) . toBeDefined ( ) ;
23
+ } ) ;
You can’t perform that action at this time.
0 commit comments