Skip to content

Commit

Permalink
feat(test): library
Browse files Browse the repository at this point in the history
  • Loading branch information
bdlukaa committed Dec 24, 2023
1 parent 77d7046 commit 65ed365
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/library_directive.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:dartdoc_json/src/utils.dart';
Map<String, dynamic> serializeLibraryDirective(LibraryDirective library) {
return filterMap(<String, dynamic>{
'kind': 'library',
'name': library.name2,
'name': library.name2?.name,
});
}

Expand Down
21 changes: 21 additions & 0 deletions test/library_directive_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import 'package:test/test.dart';

import 'utils.dart';

void main() {
group('LibraryDirective', () {
test('simple library', () {
expect(
parseAsJson('library foo;'),
{'kind': 'library', 'name': 'foo'},
);
});

// test('augment library', () {
// expect(
// parseAsJson("library augment 'main_library.dart';"),
// {'kind': 'library', 'augmentation': true, 'uri': 'main_library.dart'},
// );
// });
});
}

0 comments on commit 65ed365

Please sign in to comment.