Skip to content

Commit

Permalink
test: Modified to a more strict type (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
koji-1009 authored Dec 3, 2024
1 parent b2cdb85 commit 8cb812a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test/crypto_subtle_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void main() {
false,
)
.having(
(key) => key.usages,
(key) => key.usages.toDartList,
'usages',
containsAll(['encrypt', 'decrypt']),
),
Expand Down Expand Up @@ -198,7 +198,7 @@ void main() {
true,
)
.having(
(key) => key.publicKey.usages,
(key) => key.publicKey.usages.toDartList,
'publicKey.usages',
['encrypt'],
)
Expand All @@ -213,7 +213,7 @@ void main() {
false,
)
.having(
(key) => key.privateKey.usages,
(key) => key.privateKey.usages.toDartList,
'privateKey.usages',
['decrypt'],
),
Expand Down Expand Up @@ -246,7 +246,7 @@ void main() {
true,
)
.having(
(key) => key.publicKey.usages,
(key) => key.publicKey.usages.toDartList,
'publicKey.usages',
['encrypt'],
)
Expand All @@ -261,7 +261,7 @@ void main() {
false,
)
.having(
(key) => key.privateKey.usages,
(key) => key.privateKey.usages.toDartList,
'privateKey.usages',
['decrypt'],
),
Expand Down Expand Up @@ -293,3 +293,7 @@ void main() {
});
});
}

extension on JSArray<JSString> {
List<String> get toDartList => toDart.map((e) => e.toDart).toList();
}

0 comments on commit 8cb812a

Please sign in to comment.