Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7066114
D8481.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
748 B
Subscribers
None
D8481.id.diff
View Options
diff --git a/swh/indexer/tests/metadata_dictionary/test_npm.py b/swh/indexer/tests/metadata_dictionary/test_npm.py
--- a/swh/indexer/tests/metadata_dictionary/test_npm.py
+++ b/swh/indexer/tests/metadata_dictionary/test_npm.py
@@ -294,6 +294,20 @@
}
+def test_npm_author():
+ package_json = rb"""{
+ "version": "1.0.0",
+ "author": "Foo Bar (@example)"
+}"""
+ result = MAPPINGS["NpmMapping"]().translate(package_json)
+ assert result == {
+ "@context": "https://doi.org/10.5063/schema/codemeta-2.0",
+ "type": "SoftwareSourceCode",
+ "author": [{"name": "Foo Bar", "type": "Person"}],
+ "version": "1.0.0",
+ }
+
+
def test_npm_invalid_uris():
package_json = rb"""{
"version": "1.0.0",
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Nov 4 2024, 4:24 PM (19 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3219394
Attached To
D8481: npm: Add test for 'author' value that used to crash
Event Timeline
Log In to Comment